/* Login Styles - UPDATED WITH DEMO BUTTONS */

/* Theme variables are now centralized in theme-variables.css */

/* Screen Reader Only - Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d3d 100%);
}

.container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, var(--navy) 0%, #003d7a 100%);
    color: var(--white);
    padding: 2rem;
    text-align: center;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 50%;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.card-header p {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

.card-body {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--navy);
    font-weight: 600;
    font-size: 0.9rem;
}

[data-theme="dark"] .form-group label {
    color: var(--dark-gray);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
    background: var(--white);
    color: var(--dark-gray);
}

[data-theme="dark"] .form-group input {
    background: var(--white);
    color: var(--dark-gray);
    border-color: var(--border-color);
}

.form-group input:focus {
    outline: none;
    border-color: var(--cfa-red);
    box-shadow: 0 0 0 3px rgba(229, 22, 54, 0.1);
}

.btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-family: inherit;
}

.btn-primary {
    background: var(--cfa-red);
    color: var(--white);
    margin-bottom: 1.5rem;
}

.btn-primary:hover {
    background: #c4122f;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--white);
    color: var(--navy);
    border: 2px solid var(--navy);
}

.btn-secondary:hover {
    background: var(--navy);
    color: var(--white);
    transform: translateY(-1px);
}

/* Demo Section Styles */
.demo-section {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.demo-section p {
    color: var(--medium-gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

[data-theme="dark"] .demo-section p {
    color: var(--medium-gray);
}

.demo-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    justify-items: center;
}

.demo-buttons .btn {
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    flex: 1;
    max-width: 140px;
}

.demo-buttons .btn i {
    font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    .card-header {
        padding: 1.5rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .demo-buttons {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .demo-buttons .btn {
        max-width: none;
    }
}

/* Additional responsive improvements */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
    
    .card-header {
        padding: 1.5rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.95rem;
    }
    
    .form-group {
        margin-bottom: 1.2rem;
    }
    
    .demo-buttons {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .demo-btn {
        width: 100%;
        text-align: center;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .logo p {
        font-size: 0.9rem;
    }
}

@media (max-width: 1024px) {
    .container {
        max-width: 90%;
    }
}

@media (max-width: 320px) {
    .container {
        padding: 0.75rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .logo h1 {
        font-size: 1.2rem;
    }
    
    .logo p {
        font-size: 0.75rem;
    }
}

/* Forgot Password Link Styles */
.forgot-password-link {
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.forgot-password-link a {
    color: var(--cfa-red);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.forgot-password-link a:hover {
    color: #c4122f;
    text-decoration: underline;
}

/* Form Footer Styles */
.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.back-to-login {
    color: var(--cfa-red);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.back-to-login:hover {
    color: #c4122f;
    text-decoration: underline;
}

/* Success Message Styles */
.success-message {
    text-align: center;
    padding: 2rem;
}

.success-icon {
    font-size: 4rem;
    color: #28a745;
    margin-bottom: 1rem;
}

.success-message h3 {
    color: var(--navy);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.success-message p {
    color: var(--medium-gray);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Error Message Styles (for password reset pages) */
.error-message {
    text-align: center;
    padding: 2rem;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.error-icon {
    font-size: 4rem;
    color: var(--cfa-red);
    margin-bottom: 1rem;
}

.error-message h3 {
    color: var(--navy);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.error-message p {
    color: var(--medium-gray);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Form Text Helper */
.form-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--medium-gray);
}

/* Loading State */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Conflict Resolution Modal Styles */
.conflict-resolution-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 20000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

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

.conflict-modal-content {
    background: var(--white, #fff);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

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

.conflict-modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

.conflict-modal-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.conflict-modal-header h2 i {
    font-size: 1.3rem;
}

.conflict-modal-header p {
    margin: 0;
    opacity: 0.95;
    font-size: 0.95rem;
}

.conflict-modal-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
}

.conflicts-section,
.non-conflicts-section {
    margin-bottom: 2rem;
}

.conflicts-section h3,
.non-conflicts-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--navy, #003d7a);
}

.conflicts-section h3 {
    color: #d32f2f;
}

.non-conflicts-section h3 {
    color: #2e7d32;
}

.conflict-list,
.non-conflicts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.conflict-item {
    border: 2px solid #ff9800;
    border-radius: 6px;
    padding: 1rem;
    background: #fff3e0;
}

.conflict-field-name {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--navy, #003d7a);
    font-size: 0.95rem;
}

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

.conflict-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.conflict-option:hover {
    background: #f5f5f5;
    border-color: #ff9800;
}

.conflict-option input[type="radio"] {
    margin-top: 0.25rem;
    cursor: pointer;
}

.conflict-option input[type="radio"]:checked + .option-content {
    color: var(--navy, #003d7a);
}

.option-content {
    flex: 1;
}

.option-content strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.option-value {
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 150px;
    overflow-y: auto;
    padding: 0.5rem;
    background: #f9f9f9;
    border-radius: 4px;
    margin-top: 0.25rem;
}

.non-conflict-item {
    border: 1px solid #4caf50;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    background: #e8f5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.non-conflict-field-name {
    font-weight: 600;
    color: var(--navy, #003d7a);
    font-size: 0.9rem;
}

.non-conflict-value {
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    text-align: right;
    flex: 1;
    white-space: pre-wrap;
    word-break: break-word;
}

.conflict-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: #f9f9f9;
    border-radius: 0 0 8px 8px;
}

.conflict-modal-footer .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.conflict-modal-footer .btn-secondary {
    background: #6c757d;
    color: white;
}

.conflict-modal-footer .btn-secondary:hover {
    background: #5a6268;
}

.conflict-modal-footer .btn-warning {
    background: #ff9800;
    color: white;
}

.conflict-modal-footer .btn-warning:hover {
    background: #f57c00;
}

.conflict-modal-footer .btn-primary {
    background: var(--primary-color, #4CAF50);
    color: white;
}

.conflict-modal-footer .btn-primary:hover {
    background: #45a049;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .conflict-modal-content {
        max-width: 95%;
        max-height: 95vh;
    }

    .conflict-modal-header,
    .conflict-modal-body,
    .conflict-modal-footer {
        padding: 1rem;
    }

    .conflict-options {
        gap: 0.5rem;
    }

    .conflict-option {
        flex-direction: column;
        gap: 0.5rem;
    }

    .non-conflict-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .non-conflict-value {
        text-align: left;
    }

    .conflict-modal-footer {
        flex-direction: column;
    }

    .conflict-modal-footer .btn {
        width: 100%;
    }
}