/* ============================================
   Contractor Portal - Non-Authenticated Pages
   Login, Register, Reset Password Styles
   Forest Green Color Scheme
   ============================================ */

:root {
    --contractor-primary: #166534;
    --contractor-primary-dark: #14532d;
    --contractor-primary-light: #22c55e;
    --contractor-gradient: linear-gradient(135deg, #166534 0%, #14532d 50%, #052e16 100%);
}

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

body {
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    background: var(--contractor-gradient);
    display: flex;
    flex-direction: column;
}

/* Animated background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255,255,255,0.05) 0%, transparent 30%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   Navbar Styles
   ============================================ */

.navbar-contractor {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 0.75rem 0 !important;
    position: relative;
    z-index: 10;
}

.navbar-contractor .navbar-brand {
    font-weight: 700 !important;
    font-size: 1.5rem !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.navbar-contractor .navbar-brand img {
    height: 40px !important;
    filter: brightness(0) invert(1) !important;
}

.navbar-contractor .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    border-radius: 0.375rem !important;
    transition: all 0.2s ease !important;
}

.navbar-contractor .nav-link:hover,
.navbar-contractor .nav-link.active {
    color: white !important;
    background: rgba(255, 255, 255, 0.15) !important;
}

/* ============================================
   Main Content Area
   ============================================ */

.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* ============================================
   Auth Card Styles
   ============================================ */

.auth-card {
    background: white;
    border-radius: 1rem;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    animation: slideUp 0.5s ease forwards;
}

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

.auth-card-header {
    background: var(--contractor-gradient);
    padding: 2rem;
    text-align: center;
}

.auth-card-header h1 {
    color: white;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-card-header p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9375rem;
    margin: 0;
}

.auth-card-header .auth-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.auth-card-header .auth-icon i {
    font-size: 1.75rem;
    color: white;
}

.auth-card-body {
    padding: 2rem;
}

/* ============================================
   Form Styles
   ============================================ */

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

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.form-control:focus {
    outline: none;
    border-color: var(--contractor-primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(22, 101, 52, 0.1);
}

.form-control::placeholder {
    color: #94a3b8;
}

/* Input with icon */
.input-group {
    position: relative;
}

.input-group .form-control {
    padding-left: 2.75rem;
}

.input-group .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}

.input-group .form-control:focus + .input-icon,
.input-group .form-control:focus ~ .input-icon {
    color: var(--contractor-primary);
}

/* ============================================
   Button Styles
   ============================================ */

.btn-contractor {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--contractor-gradient);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-contractor::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-contractor:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(22, 101, 52, 0.3);
}

.btn-contractor:hover::before {
    left: 100%;
}

.btn-contractor:active {
    transform: translateY(0);
}

.btn-outline-contractor {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--contractor-primary);
    background: transparent;
    border: 2px solid var(--contractor-primary);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline-contractor:hover {
    background: var(--contractor-primary);
    color: white;
}

/* ============================================
   Alert/Message Styles
   ============================================ */

.auth-message {
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.auth-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.auth-message.info {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

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

/* ============================================
   Links
   ============================================ */

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.auth-links a {
    color: var(--contractor-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.auth-links a:hover {
    color: var(--contractor-primary-dark);
    text-decoration: underline;
}

.auth-links p {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0.5rem 0;
}

/* ============================================
   Footer
   ============================================ */

.auth-footer {
    text-align: center;
    padding: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8125rem;
    position: relative;
    z-index: 1;
}

.auth-footer a {
    color: white;
    text-decoration: none;
}

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

/* ============================================
   Page Loader
   ============================================ */

#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(22, 101, 52, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

#page-loader.show {
    display: flex;
}

#page-loader i {
    font-size: 3rem;
    color: white;
}

#page-loader #spinner-text {
    color: white !important;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 576px) {
    .auth-container {
        padding: 1rem;
    }

    .auth-card {
        border-radius: 0.75rem;
    }

    .auth-card-header {
        padding: 1.5rem;
    }

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

    .auth-card-body {
        padding: 1.5rem;
    }
}

/* ============================================
   Password Requirements
   ============================================ */

.password-requirements {
    background: #f8fafc;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
}

.password-requirements h6 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.password-requirements li {
    color: #64748b;
    padding: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.password-requirements li i {
    font-size: 0.75rem;
}

.password-requirements li.valid {
    color: #16a34a;
}

.password-requirements li.invalid {
    color: #dc2626;
}
