/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1564C0 0%, #ffffff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-variant-numeric: proportional-nums;
}

.container {
    width: 100%;
    max-width: 512px;
    margin: 0 auto;
}

.signup-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
}

.logo-section {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.brand-logo {
    height: 100px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    border-radius: 8px;
    filter: drop-shadow(0 2px 8px rgba(21, 100, 192, 0.1));
    transition: all 0.3s ease;
}

.brand-logo:hover {
    transform: scale(1.02);
    filter: drop-shadow(0 4px 12px rgba(21, 100, 192, 0.15));
}

.header {
    text-align: center;
    margin-bottom: 32px;
    margin-top: 0;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1564C0;
    margin-bottom: 8px;
}

.header p {
    font-size: 16px;
    color: #6b7280;
    font-weight: 400;
}

.signup-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"] {
    padding: 12px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
    font-variant-numeric: proportional-nums;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: #1564C0;
    box-shadow: 0 0 0 3px rgba(21, 100, 192, 0.1);
}

.form-group input[type="text"].error,
.form-group input[type="email"].error,
.form-group input[type="tel"].error,
.form-group input[type="password"].error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Password input with toggle */
.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input {
    padding-right: 50px;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 8px;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: #1564C0;
}

/* Password strength indicator */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-fill.weak {
    width: 25%;
    background: #ef4444;
}

.strength-fill.fair {
    width: 50%;
    background: #f59e0b;
}

.strength-fill.good {
    width: 75%;
    background: #10b981;
}

.strength-fill.strong {
    width: 100%;
    background: #059669;
}

.strength-text {
    font-size: 12px;
    margin-top: 4px;
    color: #6b7280;
}

/* Checkbox group */
.checkbox-group {
    margin: 8px 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked+.checkmark {
    background: #1564C0;
    border-color: #1564C0;
}

.checkbox-label input[type="checkbox"]:checked+.checkmark::after {
    content: "✓";
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-text {
    color: #374151;
}

.link-btn {
    background: none;
    border: none;
    color: #1564C0;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    padding: 0;
}

.link-btn:hover {
    color: #1e40af;
}

/* Submit button */
.submit-btn {
    background: #1564C0;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    position: relative;
    min-height: 52px;
}

.submit-btn:hover:not(:disabled) {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(21, 100, 192, 0.3);
}

.submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Button text and loading states */
.submit-btn .btn-text {
    transition: opacity 0.2s ease;
}

.submit-btn.loading .btn-text {
    opacity: 0;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner.hidden {
    display: none;
}

.loading-spinner i {
    font-size: 16px;
    animation: spin 1s linear infinite;
    color: white;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Login link */
.login-link {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: #6b7280;
}

.login-link a {
    color: #1564C0;
    text-decoration: none;
    font-weight: 500;
}

.login-link a:hover {
    text-decoration: underline;
}

/* Error messages */
.error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.2s ease;
    line-height: 1.3;
}

.error-message.show {
    opacity: 1;
    max-height: 50px;
    /* Enough for multi-line error messages */
    margin-bottom: 4px;
}

.error-message:empty {
    margin: 0;
    max-height: 0;
}

/* Modal styles */
.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: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1564C0;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 24px;
}

.terms-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 16px 0 8px 0;
}

.terms-content h3:first-child {
    margin-top: 0;
}

.terms-content p {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 12px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: #1564C0;
    color: white;
}

.btn-primary:hover {
    background: #1e40af;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* Success and Error modals */
.success-modal,
.error-modal {
    text-align: center;
}

.success-modal h2 {
    color: #10b981;
    margin: 16px 0 16px 0;
}

.success-modal p {
    margin-bottom: 24px;
}

.error-modal h2 {
    color: #ef4444;
    margin: 16px 0 8px 0;
}

.error-modal #errorMessage {
    margin-bottom: 32px;
}

/* reCAPTCHA Modal specific styles */
#recaptcha-modal .modal-content {
    max-width: 400px;
}

#recaptcha-modal .modal-body {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

#recaptcha-modal .modal-header h2 {
    color: #374151;
    font-size: 18px;
}

/* reCAPTCHA styling adjustments */
.g-recaptcha {
    display: inline-block;
}

/* Loading state for reCAPTCHA */
#recaptcha-modal .loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: #6b7280;
}

#recaptcha-modal .loading i {
    font-size: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.text-center {
    text-align: center;
}

/* Utility classes */
.hidden {
    display: none;
}

/* Responsive design */
@media (max-width: 600px) {
    body {
        padding: 16px;
    }

    .signup-card {
        padding: 24px;
    }

    .header h1 {
        font-size: 24px;
    }

    .brand-logo {
        height: 80px;
        max-width: 160px;
    }

    .logo-section {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .modal {
        padding: 16px;
    }

    .modal-content {
        margin: 0;
    }
}

@media (max-width: 400px) {
    .signup-card {
        padding: 20px;
    }

    .brand-logo {
        height: 60px;
        max-width: 120px;
    }

    .logo-section {
        margin-bottom: 8px;
        padding-bottom: 8px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-header,
    .modal-footer {
        padding: 16px 20px;
    }
}