/* ===================================
   E-book DRM - Estilos do Formulário
   =================================== */

:root {
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --warning-color: #f39c12;
    --border-radius: 4px;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Container */
.ebook-drm-container {
    width: 100%;
    margin: 20px 0;
}

.ebook-drm-form-wrapper {
    max-width: 500px;
    margin: 0 auto;
    background: var(--ebook-form-bg, white);
    border-radius: var(--ebook-border-radius, var(--border-radius));
    box-shadow: var(--ebook-box-shadow, var(--box-shadow));
    padding: 30px;
}

/* Input variables (set via Elementor selectors as CSS vars) */
.ebook-drm-form-wrapper {
    --ebook-input-bg: var(--ebook-input-bg, #ffffff);
    --ebook-input-border: var(--ebook-input-border, #dddddd);
    --ebook-input-placeholder: var(--ebook-input-placeholder, #999999);
}

/* Title */
.ebook-drm-title {
    font-size: 24px;
    margin: 0 0 25px 0;
    color: #333;
    text-align: center;
}

/* Form */
.ebook-drm-form {
    display: flex;
    flex-direction: column;
}

/* Field */
.ebook-drm-field {
    margin-bottom: 20px;
}

.ebook-drm-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .ebook-drm-field-row {
        grid-template-columns: 1fr;
    }
}

.ebook-drm-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: inherit;
    font-size: 14px;
}

.ebook-drm-field label .required {
    color: var(--error-color);
}

/* Input */
.ebook-drm-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--ebook-input-border, #ddd);
    border-radius: var(--border-radius);
    background: var(--ebook-input-bg, #fff);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
    color: inherit;
}

.ebook-drm-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ebook-drm-input::placeholder {
    color: var(--ebook-input-placeholder, #999);
}

/* Message */
.ebook-drm-message {
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    font-size: 14px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ebook-drm-message.success {
    background: var(--ebook-msg-success-bg, #d4edda);
    border: 1px solid var(--ebook-msg-success-border, #c3e6cb);
    color: var(--ebook-msg-success-color, #155724);
}

.ebook-drm-message.error {
    background: var(--ebook-msg-error-bg, #f8d7da);
    border: 1px solid var(--ebook-msg-error-border, #f5c6cb);
    color: var(--ebook-msg-error-color, #721c24);
}

.ebook-drm-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Button */
.ebook-drm-button {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.ebook-drm-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.ebook-drm-button:active {
    transform: translateY(0);
}

.ebook-drm-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ebook-drm-button-primary {
    background: linear-gradient(135deg, var(--success-color), #229954);
}

.ebook-drm-button-primary:hover {
    box-shadow: 0 4px 16px rgba(39, 174, 96, 0.3);
}

/* Spinner */
.ebook-drm-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Terms */
.ebook-drm-terms {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 15px;
    line-height: 1.6;
}

.ebook-drm-terms a {
    color: var(--primary-color);
    text-decoration: none;
}

.ebook-drm-terms a:hover {
    text-decoration: underline;
}

/* Modal */
.ebook-drm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.ebook-drm-modal-content {
    background: var(--ebook-modal-bg, white);
    border-radius: var(--ebook-border-radius, var(--border-radius));
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideUp 0.3s ease-out;
    box-shadow: var(--ebook-modal-box-shadow, 0 10px 40px rgba(0, 0, 0, 0.3));
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ebook-drm-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.ebook-drm-modal-close:hover {
    color: #333;
}

.ebook-drm-modal-body {
    padding: 40px 30px;
    text-align: center;
}

.ebook-drm-modal-body h2 {
    color: var(--success-color);
    margin: 0 0 15px 0;
    font-size: 28px;
}

.ebook-drm-modal-body > p {
    color: #666;
    margin-bottom: 20px;
}

#ebook-drm-download-btn {
    margin: 20px 0;
}

.ebook-drm-modal-footer {
    font-size: 14px;
    color: #666;
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

/* Responsive */
@media (max-width: 600px) {
    .ebook-drm-form-wrapper {
        padding: 20px;
    }

    .ebook-drm-title {
        font-size: 20px;
    }

    .ebook-drm-modal-content {
        max-width: 95%;
    }

    .ebook-drm-modal-body {
        padding: 30px 20px;
    }
}
