/* Ubuntu Farming Authentication Pages */

:root {
    /* Ubuntu Farming Brand Colors */
    --primary-color: #4a6741;          /* Forest green - main brand */
    --secondary-color: #5c7a52;        /* Olive green - secondary */
    --accent-color: #7a9b71;           /* Light green - accents */

    /* Text Colors */
    --text-primary: #3d2817;           /* Dark brown - primary text */
    --text-secondary: #6b5d4f;         /* Mid brown - secondary text */
    --text-light: #8a7d6f;             /* Light brown - subtle text */

    /* Background Colors */
    --bg-primary: #ffffff;             /* White - cards/panels */
    --bg-secondary: #f5f2ed;           /* Warm white - page background */
    --bg-sidebar: #3d2817;             /* Dark brown - sidebar */
    --bg-cream: #e8e3db;               /* Cream - alternative background */

    /* Border & Dividers */
    --border-color: #cdc5b8;           /* Tan - borders */
    --divider-color: #e8e3db;          /* Cream - dividers */

    /* Shadows */
    --shadow: 0 1px 3px 0 rgba(61, 40, 23, 0.1), 0 1px 2px 0 rgba(61, 40, 23, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(61, 40, 23, 0.1), 0 4px 6px -2px rgba(61, 40, 23, 0.05);

    /* Border Radius */
    --radius: 0.5rem;
    --radius-lg: 0.75rem;

    /* Status Colors */
    --error-color: #c73e1d;            /* Warm red */
    --success-color: #4a6741;          /* Brand green */
    --warning-color: #d4a056;          /* Warm amber */
    --info-color: #5c7a52;             /* Olive green */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f5f2ed 0%, #e8e3db 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 480px;
    width: 100%;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Wider container for registration forms with more fields */
.auth-container.wide {
    max-width: 580px;
}

.auth-card {
    width: 100%;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.logo i {
    font-size: 2rem;
}

/* Logo image styling - compatible with SVG, JPG, and PNG formats */
.logo-image {
    height: 150px;
    width: auto;
    max-width: 300px;
    object-fit: contain;
    display: block;
    background-color: #ffffff;
    padding: 20px 28px;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(61, 40, 23, 0.12);
}

/* SVG-specific optimizations */
.logo-image[src$=".svg"] {
    height: 150px;
    width: auto;
}

/* PNG logo with white background */
.logo-image[src$=".png"] {
    height: 130px;
    padding: 24px 32px;
}

/* JPG logo styling */
.logo-image[src$=".jpg"],
.logo-image[src$=".jpeg"] {
    height: 130px;
    padding: 20px 28px;
    border-radius: 14px;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.field-optional {
    font-weight: 400;
    color: var(--text-light);
    font-size: 0.8125rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 1rem;
    color: var(--text-light);
    z-index: 1;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: #ffffff;
    color: #1f2937;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-group input::placeholder {
    color: #6b7280;
    opacity: 1;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 103, 65, 0.1);
}

.password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    z-index: 1;
    padding: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.password-toggle:focus {
    outline: none;
}

.password-toggle:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: var(--radius);
}

.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-fill.weak {
    width: 33%;
    background: var(--error-color);
}

.strength-fill.medium {
    width: 66%;
    background: var(--warning-color);
}

.strength-fill.strong {
    width: 100%;
    background: var(--success-color);
}

.strength-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    display: block;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.5rem 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.checkbox-label input[type="checkbox"]:focus-visible + .checkmark {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 3px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--secondary-color);
}

.forgot-password:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 2px;
}

.terms-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.terms-link:hover {
    text-decoration: underline;
}

.terms-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 2px;
}

.auth-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.auth-btn:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

.auth-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-divider {
    text-align: center;
    position: relative;
    margin: 1rem 0;
}

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

.auth-divider span {
    background: var(--bg-primary);
    padding: 0 1rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

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

.social-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.social-btn:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.social-btn.google:hover {
    border-color: #db4437;
    color: #db4437;
}

.social-btn.facebook:hover {
    border-color: #4267B2;
    color: #4267B2;
}

.social-btn.google-fallback {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
}

.social-btn.google-fallback:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
    transform: none;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

/* Short label line above footer action buttons */
.auth-footer-hint {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.3;
}

.auth-footer-hint:not(:first-child) {
    margin-top: 0.5rem;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Auth Footer Button Style */
.auth-footer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-footer-btn:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary);
    color: var(--primary-color);
    text-decoration: none;
    transform: translateY(-1px);
}

.auth-footer-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.auth-footer-btn i {
    font-size: 1rem;
}

.auth-footer-btn.secondary {
    background: transparent;
    border-color: var(--accent-color);
    color: var(--text-secondary);
}

.auth-footer-btn.secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(74, 103, 65, 0.05);
}

/* Demo Credentials */
.demo-credentials {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-color);
}

.demo-credentials h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.demo-credentials h4::before {
    content: "🔑";
    font-size: 1.25rem;
}

.credential-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.credential-item:last-child {
    border-bottom: none;
}

.credential-item strong {
    color: var(--text-primary);
    font-size: 0.875rem;
}

.credential-item span {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
    background: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    border: 1px solid var(--border-color);
}

.auth-sidebar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.sidebar-content {
    position: relative;
    z-index: 1;
}

.sidebar-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.sidebar-content p {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.feature i {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.benefits {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.benefit {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.benefit i {
    font-size: 1.5rem;
    margin-top: 0.25rem;
}

.benefit h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.benefit p {
    font-size: 0.875rem;
    opacity: 0.8;
    line-height: 1.5;
}

/* Notification styles are defined in style.css for consistency */

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        max-width: 100%;
        margin: 0 1rem;
    }

    .auth-card {
        padding: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .auth-header h1 {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .auth-header h1 {
        font-size: 1.5rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .logo i {
        font-size: 1.75rem;
    }
}

/* Form Validation Styles */
.form-group.error input,
.form-group.error select {
    border-color: var(--error-color);
}

.form-group.error .error-message {
    color: var(--error-color);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.form-group.success input,
.form-group.success select {
    border-color: var(--success-color);
}

/* Loading State */
.auth-btn.loading {
    position: relative;
    color: transparent;
}

.auth-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Modal Styles */
.error-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

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

.error-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    padding: 0;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.error-modal-header {
    background: var(--error-color);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.error-modal-header i {
    font-size: 1.25rem;
}

.error-modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.error-modal-body {
    padding: 1.5rem;
}

.error-modal-message {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.error-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.error-modal-btn {
    padding: 0.625rem 1.25rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.error-modal-btn:hover {
    background: var(--secondary-color);
}

/* Success Modal Styles */
.success-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.success-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    padding: 0;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.success-modal-header {
    background: var(--success-color);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.success-modal-header i {
    font-size: 1.25rem;
}

.success-modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}
