﻿/* Forest Contractors Auth Server Styles */

/* CSS Variables for consistent theming */
:root {
    --forest-green: #19494d;
    --forest-light-green: #19494d;
    --forest-dark-green: #19494d;
    --forest-accent: #8bc34a;
    --forest-gray: #f8f9fa;
    --forest-white: #ffffff;
    --forest-text-dark: #333333;
    --forest-text-muted: #6c757d;
    --forest-border: #e9ecef;
    --forest-shadow: rgba(0, 0, 0, 0.1);
    --forest-success: #28a745;
    --forest-danger: #dc3545;
    --forest-warning: #ffc107;
    --forest-info: #17a2b8;
}

/* Base body styling */
body {
    background: linear-gradient(135deg, var(--forest-gray) 0%, #e8f5e8 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--forest-text-dark);
    line-height: 1.6;
}

/* Auth container - centers content */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Main auth card styling */
.auth-card {
    background: var(--forest-white);
    border-radius: 16px;
    box-shadow: 0 10px 30px var(--forest-shadow);
    overflow: hidden;
    max-width: 440px;
    width: 100%;
    border: 1px solid var(--forest-border);
}

    /* Large auth card for test pages */
    .auth-card.large {
        max-width: 600px;
    }

/* Auth header with gradient background */
.auth-header {
    color: var(--forest-white);
    padding-inline: 30px;
    text-align: center;
    position: relative;
}

    .auth-header::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: rgba(255, 255, 255, 0.2);
    }

    .auth-header h1 {
        margin: 0;
        font-size: 1.8rem;
        font-weight: 600;
        letter-spacing: -0.5px;
    }

    .auth-header p {
        margin: 8px 0 0 0;
        opacity: 0.9;
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--forest-green);
    }

/* Logo icon styling */
.logo {
    width: 200px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Auth body content area */
.auth-body {
    padding: 30px;
    background: var(--forest-white);
}

/* Authentication method toggle */
.auth-toggle {
    display: flex;
    background: var(--forest-gray);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--forest-border);
}

.auth-toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

    .auth-toggle-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--forest-green);
        transform: scaleX(0);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 0;
    }

    .auth-toggle-btn.active::before {
        transform: scaleX(1);
    }

    .auth-toggle-btn.active {
        color: var(--forest-white) !important;
        box-shadow: 0 2px 8px rgba(45, 90, 39, 0.3);
        z-index: 1;
    }

        .auth-toggle-btn.active * {
            position: relative;
            z-index: 2;
            color: var(--forest-white) !important;
        }

    .auth-toggle-btn:not(.active) {
        color: var(--forest-text-muted);
    }

        .auth-toggle-btn:not(.active):hover {
            background: #e9ecef;
            color: var(--forest-text-dark);
        }

    .auth-toggle-btn i,
    .auth-toggle-btn span {
        position: relative;
        z-index: 2;
    }

/* Form controls */
.form-control {
    border-radius: 10px;
    border: 2px solid var(--forest-border);
    padding: 12px 16px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: var(--forest-white);
    line-height: 1.5;
}

    .form-control:focus {
        border-color: var(--forest-accent);
        box-shadow: 0 0 0 0.2rem rgba(139, 195, 74, 0.25);
        outline: none;
        background: var(--forest-white);
    }

    .form-control::placeholder {
        color: #adb5bd;
        opacity: 1;
    }

/* Form labels */
.form-label {
    font-weight: 500;
    color: var(--forest-text-dark);
    margin-bottom: 6px;
    font-size: 0.9rem;
}

/* Primary buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--forest-green) 0%, var(--forest-light-green) 100%);
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

    .btn-primary::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, var(--forest-dark-green) 0%, var(--forest-green) 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .btn-primary:hover::before {
        opacity: 1;
    }

    .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(45, 90, 39, 0.3);
    }

    .btn-primary:active {
        transform: translateY(0);
    }

    .btn-primary i,
    .btn-primary span {
        position: relative;
        z-index: 1;
    }

/* Secondary buttons */
.btn-outline-secondary {
    border: 2px solid var(--forest-border);
    border-radius: 10px;
    padding: 12px 24px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: var(--forest-white);
    color: var(--forest-text-muted);
}

    .btn-outline-secondary:hover {
        background: var(--forest-gray);
        border-color: #adb5bd;
        color: var(--forest-text-dark);
        transform: translateY(-1px);
    }

/* Success buttons */
.btn-outline-success {
    border: 2px solid var(--forest-accent);
    color: var(--forest-green);
    border-radius: 10px;
}

    .btn-outline-success:hover {
        background: var(--forest-accent);
        border-color: var(--forest-accent);
        color: var(--forest-white);
    }

/* Danger buttons */
.btn-outline-danger {
    border: 2px solid var(--forest-danger);
    color: var(--forest-danger);
    border-radius: 10px;
}

    .btn-outline-danger:hover {
        background: var(--forest-danger);
        border-color: var(--forest-danger);
        color: var(--forest-white);
    }

/* Small buttons */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
    border-radius: 8px;
    font-weight: 500;
}

/* Alert components */
.alert {
    border-radius: 10px;
    border: none;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

    .alert i {
        margin-right: 8px;
    }

.alert-danger {
    background: #fee;
    color: #c53030;
    border-color: #fed7d7;
}

.alert-success {
    background: #f0fff4;
    color: var(--forest-green);
    border-color: #c6f6d5;
}

.alert-warning {
    background: #fffaf0;
    color: #d69e2e;
    border-color: #fbd38d;
}

.alert-info {
    background: #ebf8ff;
    color: #2b6cb0;
    border-color: #bee3f8;
}

/* Form elements */
.auth-form {
    transition: all 0.3s ease;
}

    .auth-form.hidden {
        display: none;
        opacity: 0;
    }

.form-check {
    margin: 16px 0;
}

.form-check-input {
    border-radius: 4px;
    border: 2px solid var(--forest-border);
}

    .form-check-input:checked {
        background-color: var(--forest-green);
        border-color: var(--forest-green);
    }

    .form-check-input:focus {
        box-shadow: 0 0 0 0.2rem rgba(139, 195, 74, 0.25);
    }

.form-check-label {
    font-size: 0.9rem;
    color: var(--forest-text-dark);
    margin-left: 8px;
}

/* Text styling */
.text-muted {
    font-size: 0.875rem;
    color: var(--forest-text-muted) !important;
}

/* Contractor switching styles */
.contractor-list {
    max-height: 400px;
    overflow-y: auto;
}

.contractor-card .card {
    border: 2px solid var(--forest-border);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--forest-white);
    margin-bottom: 12px;
}

    .contractor-card .card:hover {
        border-color: var(--forest-accent);
        box-shadow: 0 4px 12px rgba(139, 195, 74, 0.15);
        transform: translateY(-2px);
        cursor: pointer;
    }

.contractor-card .card-title {
    color: var(--forest-green);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.contractor-card .card-text {
    margin-bottom: 4px;
    line-height: 1.4;
}

/* Badge components */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
}

    .badge.bg-success {
        background-color: var(--forest-accent) !important;
        color: var(--forest-white);
    }

    .badge.bg-secondary {
        background-color: var(--forest-text-muted) !important;
        color: var(--forest-white);
    }

    .badge.bg-primary {
        background-color: var(--forest-green) !important;
    }

/* Code blocks and technical content */
.code-block {
    background: var(--forest-gray);
    border: 1px solid var(--forest-border);
    border-radius: 8px;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    word-break: break-all;
    position: relative;
    margin: 12px 0;
    line-height: 1.4;
}

    .code-block pre {
        margin: 0;
        white-space: pre-wrap;
        word-wrap: break-word;
        background: none;
        border: none;
        padding: 0;
        font-size: inherit;
        color: inherit;
    }

    .code-block code {
        background: none;
        padding: 0;
        color: #d63384;
        font-weight: 500;
        font-size: inherit;
    }

/* Card components */
.card {
    border-radius: 12px;
    border: 1px solid var(--forest-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

    .card:hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

.card-title {
    font-weight: 600;
    color: var(--forest-text-dark);
}

.card-text {
    color: var(--forest-text-muted);
}

/* Loading states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Focus visible for accessibility */
.btn:focus-visible,
.form-control:focus-visible,
.auth-toggle-btn:focus-visible {
    outline: 2px solid var(--forest-accent);
    outline-offset: 2px;
}

/* Selection styling */
::selection {
    background: rgba(139, 195, 74, 0.3);
    color: var(--forest-text-dark);
}

/* Scrollbar styling for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--forest-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--forest-border);
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--forest-text-muted);
    }

/* Responsive design */
@media (max-width: 768px) {
    .auth-card {
        margin: 10px;
        border-radius: 12px;
        max-width: none;
    }

    .auth-header, .auth-body {
        padding: 20px;
    }

    .auth-toggle-btn {
        padding: 10px 16px;
        font-size: 0.875rem;
    }

    .btn {
        font-size: 0.9rem;
        padding: 10px 20px;
    }

    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 576px) {
    .auth-container {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }

    .auth-body {
        padding: 15px;
    }

    .contractor-card .card-body {
        padding: 12px;
    }

    .btn-sm {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}

/* Print styles */
@media print {
    .auth-container {
        background: white;
    }

    .auth-card {
        box-shadow: none;
        border: 1px solid #000;
    }

    .auth-header {
        background: #f8f9fa !important;
        color: #000 !important;
    }

    .btn {
        border: 1px solid #000;
        background: white !important;
        color: #000 !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --forest-border: #000;
        --forest-text-muted: #000;
    }

    .form-control {
        border-width: 3px;
    }

    .btn {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .btn:hover {
        transform: none;
    }

    .contractor-card .card:hover {
        transform: none;
    }
}
