

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 24px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    border: 2px solid #2D3748;
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background-image: url('../img/frame.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 26px;
    z-index: -1;
}

@keyframes modalSlideIn {
    from { 
        opacity: 0; 
        transform: translateY(-30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: #333;
    background: #f0f0f0;
}

.auth-modal {
    max-width: 420px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-title {
    font-size: 2em;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-form {
    margin-bottom: 25px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form .form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.auth-form .form-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    transition: var(--transition);
    background: #fafbfc;
}

.auth-form .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: white;
}

.auth-form .form-input.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.help-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
}

.checkbox-text {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    line-height: 1.4;
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: white;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 8px;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.checkbox-container:hover .checkmark {
    border-color: var(--primary-color);
}

.link-text {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 800;
}

.link-text:hover {
    text-decoration: underline;
}

.auth-form .submit-btn {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(255, 107, 107, 0.2));
    color: var(--text-primary);
    border: none;
    padding: 18px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    width: 100%;
    margin-top: 10px;
}

.auth-form .submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.auth-form .submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.auth-footer p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.switch-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
    transition: var(--transition);
}

.switch-btn:hover {
    color: var(--secondary-color);
}

.form-error {
    color: var(--error-color);
    font-size: 13px;
    margin-top: 6px;
    display: none;
    animation: fadeInError 0.3s ease-out;
}

.form-error.show {
    display: block;
}

@keyframes fadeInError {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.limit-content {
    text-align: center;
    padding: 20px 0;
}

.limit-message {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.limit-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.auth-btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
}

.auth-btn.primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(255, 107, 107, 0.2));
    color: var(--text-primary);
    border: none;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.auth-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.auth-btn.primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-btn.secondary {
    background: white;
    color: var(--text-secondary);
    border: 2px solid #e5e7eb;
}

.auth-btn.secondary:hover {
    background: #f8f9fa;
    color: var(--text-primary);
    border-color: var(--border-color);
    transform: translateY(-1px);
}

.help-modal {
    max-width: 360px;
}

.help-content {
    margin: 20px 0;
    line-height: 1.6;
}

.help-content p {
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.terms-modal {
    max-width: 600px;
    max-height: 80vh;
}

.terms-content {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    max-height: 50vh;
    overflow-y: auto;
    line-height: 1.6;
    font-size: 14px;
}

.terms-content p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.terms-section {
    margin-bottom: 25px;
}

.terms-section h4 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.terms-section h5 {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    margin: 12px 0 8px 0;
}

.terms-section ul {
    margin: 8px 0 15px 0;
    padding-left: 20px;
    list-style-type: disc;
}

.terms-section li {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 5px;
}

.terms-section p strong {
    color: var(--text-primary);
    font-weight: 600;
}

.terms-agreement-section {
    margin: 15px 0;
}

.checkbox-text {
    flex: 1;
    line-height: 1.4;
}

.checkbox-container input[type="checkbox"]:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.checkbox-container input[type="checkbox"]:focus + .checkmark {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.terms-agreement-section .form-error {
    margin-top: 8px;
    font-size: 13px;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.verification-info {
    text-align: center;
    margin-bottom: 30px;
}

.verification-info p {
    margin-bottom: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.verification-info p:first-child {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 16px;
}

.verification-steps {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.step {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
}

.step:last-child {
    margin-bottom: 0;
}

.step-number {
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.step span:last-child {
    color: var(--text-primary);
    font-size: 14px;
}

.verification-actions {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.verification-actions .btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-align: center;
    text-decoration: none;
}

.verification-actions .btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.verification-actions .btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.verification-actions .btn-outline {
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--primary-color);
}

.verification-actions .btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.verification-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#verificationEmail {
    color: var(--text-primary);
    font-weight: 600;
}

@media (max-width: 768px) {
    .modal-content {
        padding: 30px 25px;
        margin: 20px;
        border-radius: 20px;
    }

    .auth-title {
        font-size: 1.6em;
    }

    .auth-form .form-input {
        padding: 14px 18px;
        font-size: 15px;
    }

    .auth-form .submit-btn {
        padding: 16px 32px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 25px 20px;
        margin: 15px;
        width: calc(100% - 30px);
    }

    .auth-title {
        font-size: 1.4em;
    }

    .modal-close {
        top: 15px;
        right: 20px;
        font-size: 24px;
    }

    .help-btn {
        width: 18px;
        height: 18px;
        font-size: 11px;
    }

    .checkmark {
        width: 18px;
        height: 18px;
    }
}
