/* Modern Forms CSS - Shared styling for login and signup forms */

:root {
    --background: #fffcf4;
    --foreground: #292724;
    --muted: #7f7d7c;
    --muted-foreground: #889797;
    --border: #dfe1e6;
    --input: #ffffff;
    --primary: #386df0;
    --primary-foreground: #ffffff;
    --secondary: #f5f2e9;
    --accent: #e0d0b8;
    --accent-foreground: #292724;
    --destructive: #c3133b;
    --destructive-foreground: #ffffff;
    --ring: #386df0;
    --radius: 0.75rem;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--foreground);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-weight: 400;
}

.container {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem 0.75rem 0.75rem 0.75rem;
}

@media (min-width: 768px) {
    .container {
        padding: 1rem;
    }
}

.form-container {
    width: 100%;
    max-width: 20rem;
}

.form-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
}

.logo {
    display: flex;
    width: 1.5rem;
    height: 1.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    background: var(--primary);
    color: var(--primary-foreground);
}

.logo svg {
    width: 1rem;
    height: 1rem;
}

.title {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 0;
    color: #545250;
}

.subtitle {
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted);
}

.subtitle a {
    text-decoration: underline;
    text-underline-offset: 4px;
    color: var(--foreground);
    transition: color 0.2s ease;
}

.subtitle a:hover {
    color: var(--primary);
}

.form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-group {
    display: grid;
    gap: 0.375rem;
}

.label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
}

.input {
    display: flex;
    height: 2.25rem;
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background: var(--input);
    padding: 0 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.input:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 3px rgba(56, 109, 240, 0.15);
}

.input::placeholder {
    color: var(--muted-foreground);
}

.phone-group {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem;
}

.country-select {
    display: flex;
    height: 2.25rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background: var(--input);
    padding: 0 0.5rem;
    font-size: 0.875rem;
    min-width: 3.5rem;
}

.submit-button {
    display: flex;
    height: 2.25rem;
    width: 100%;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: var(--primary);
    color: var(--primary-foreground);
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.submit-button:hover {
    background: #2d57c0;
}

.submit-button:active {
    transform: translateY(1px);
}

.submit-button.secondary {
    background: var(--secondary);
    color: var(--foreground);
}

.submit-button.secondary:hover {
    background: #e8e5de;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.divider {
    position: relative;
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted);
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
    z-index: 0;
}

.divider span {
    background: var(--background);
    padding: 0 0.5rem;
    position: relative;
    z-index: 10;
}

.social-buttons {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr 1fr;
}

.social-button {
    display: flex;
    height: 2.5rem;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.375rem;
    background: var(--secondary);
    color: var(--accent-foreground);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.social-button:hover {
    background: var(--accent);
}

.social-button svg {
    width: 1rem;
    height: 1rem;
}

.terms {
    text-align: center;
    font-size: 0.65rem;
    color: var(--muted);
    line-height: 1.4;
}

.terms a {
    text-decoration: underline;
    text-underline-offset: 4px;
    color: var(--foreground);
    transition: color 0.2s ease;
}

.terms a:hover {
    color: var(--primary);
}

.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Modern Alert System */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: #fed7aa;
    color: #d97706;
}

.alert-info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.alert-icon {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    margin-top: 0.0625rem;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 500;
    margin-bottom: 0.125rem;
    font-size: 0.75rem;
}

.alert-description {
    color: inherit;
    opacity: 0.85;
    font-size: 0.6875rem;
}

.alert-list {
    margin: 0.375rem 0 0 0;
    padding-left: 0.875rem;
}

.alert-list li {
    margin-bottom: 0.125rem;
    font-size: 0.6875rem;
}

.captcha-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.captcha-image {
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 0.25rem;
    width: 100%;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.field-group.valid .input {
    border-color: #048d6a;
    box-shadow: 0 0 0 1px rgba(4, 141, 106, 0.1);
}

.field-group.invalid .input {
    border-color: var(--destructive);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.1);
}

.validation-message {
    font-size: 0.75rem;
    margin-top: 0.125rem;
}

.validation-message.valid {
    color: #048d6a;
}

.validation-message.invalid {
    color: var(--destructive);
}

.validation-message.strength-weak {
    color: #ef4444;
    background: none;
}

.validation-message.strength-fair {
    color: #f59e0b;
    background: none;
}

.validation-message.strength-good {
    color: #10b981;
    background: none;
}

.validation-message.strength-strong {
    color: #059669;
    background: none;
}

.password-strength {
    height: 0.25rem;
    background: var(--secondary);
    border-radius: 0.125rem;
    overflow: hidden;
    margin-top: 0.125rem;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 0.125rem;
}

.strength-weak { background: #c3133b; width: 25%; }
.strength-fair { background: #d47404; width: 50%; }
.strength-good { background: #048d6a; width: 75%; }
.strength-strong { background: #037053; width: 100%; }

.field-wrapper {
    position: relative;
}

.footer-links {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    text-align: center;
}

.footer-links span {
    display: inline-block;
    margin: 0 0.5rem;
}

.footer-links .float-right {
    float: right;
}

.footer-links a {
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Code input styling for verification codes */
.code-inputs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0;
}

.code-digit {
    width: 3rem;
    height: 4rem;
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--input);
    color: var(--foreground);
    transition: all 0.2s ease;
}

.code-digit:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(56, 109, 240, 0.15);
    background: #ffffff;
}

.code-digit.filled {
    background: #f0f9ff;
    border-color: var(--primary);
    color: var(--primary);
}

.code-digit.error {
    border-color: var(--destructive);
    background: #fef2f2;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Mobile responsiveness for code inputs */
@media (max-width: 480px) {
    .code-inputs {
        gap: 0.25rem;
    }
    
    .code-digit {
        width: 2.5rem;
        height: 3.5rem;
        font-size: 1.25rem;
    }
}
