﻿/* 
 * public.css - used for Login.cshtml
 */

/* ==========================================================================
   1. CSS Variables / Custom Properties
   ========================================================================== */
:root {
    /* Colors */
    --bs-primary: #4c84ff;
    --bs-primary-hover: #3a70e0;
    --bs-body-bg: #cbd0dd;
    --bs-card-bg: #fff;
    --bs-feature-bg: #f0f3f9;
    --bs-text-color: #555;
    --bs-text-muted: #6c757d;
    --bs-border-color: #dee2e6;
    --bs-input-border: #e0e0e0;
    --bs-border-radius: 12px;
    --bs-border-radius-sm: 6px;
    --bs-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --bs-input-height: 48px;
    --bs-spacing-xs: 0.25rem;
    --bs-spacing-sm: 0.5rem;
    --bs-spacing: 1rem;
    --bs-spacing-md: 1.5rem;
    --bs-spacing-lg: 2rem;
    --bs-spacing-xl: 2.5rem;
    --bs-spacing-xxl: 3rem;
    /* Additional colors from refactored CSS */
    --color-primary: #4c84ff;
    --color-primary-hover: #3a70e0;
    --color-body-bg: #cbd0dd;
    --color-card-bg: #fff;
    --color-feature-bg: #f0f3f9;
    --color-text: #555;
    --color-text-muted: #6c757d;
    --color-border: #dee2e6;
    --color-input-border: #e0e0e0;
    --color-error: #dc3545;
    --color-error-bg: #f8d7da;
    --color-error-border: #f5c6cb;
    --color-success: #28a745;
    --color-success-bg: #d4edda;
    --color-success-border: #c3e6cb;
    --color-icon: #000;
    --color-feature-icon: green;
    /* Additional sizing */
    --icon-size: 1.2rem;
    --input-padding: 40px;
}

/* ==========================================================================
   2. Base Styles
   ========================================================================== */
body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    _background: var(--bs-body-bg);
    background-image: url('/img/background-public.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: var(--bs-spacing);
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* ==========================================================================
   3. Card Structure
   ========================================================================== */
.auth-card {
    width: 100%;
    max-width: 1000px;
    border-radius: var(--bs-border-radius);
    box-shadow: var(--bs-shadow);
    overflow: hidden;
    background: var(--bs-card-bg);
    margin: 0 auto;
}

/* Left column */
.left-column {
    background-color: var(--bs-feature-bg)
}

.feature-item {
    color: var(--bs-text-color);
    margin-bottom: var(--bs-spacing);
    display: flex;
    align-items: center;
}

    .feature-item:last-child {
        margin-bottom: 0;
    }

    .feature-item i {
        margin-right: var(--bs-spacing-sm);
        color: green;
    }

/* Right column */
.right-column {}

/* ==========================================================================
   4. Form Elements
   ========================================================================== */

/* Dividers */

#username-divider {
    position: relative;

}

    #username-divider .divider-text-container {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background-color: var(--bs-card-bg);
        padding: 0 var(--bs-spacing);
    }

        #username-divider .divider-text-container span {
            color: var(--bs-text-muted);
            font-size: 1rem;
        }

/* Input groups */
.input-icon {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: var(--bs-spacing);
    width: 100%;
}

    .input-icon #toggle-password {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 5;
        color: var(--bs-text-muted);
    }

    .input-icon #icon-left {
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 5;
        color: var(--bs-text-muted);
    }

    .input-icon input {
        width: 100%;
        padding-right: var(--input-padding);
        padding-left: var(--input-padding);
    }

/* Password container */
.password-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.password-input {
    width: 100%;
    padding-right: 40px; /* Space for icon */
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

/* Toggle password icon */
.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 5;
}

    .toggle-password i {
        font-size: var(--icon-size);
    }

/* Form controls */
.form-control {
    width: 100%;
    -padding-left: 40px;
    height: var(--bs-input-height);
    border-radius: var(--bs-border-radius-sm);
    border: 1px solid var(--bs-input-border);
    box-sizing: border-box;
    font-size: 1rem;
}

    .form-control:focus {
        box-shadow: 0 0 0 0.25rem rgba(76, 132, 255, 0.25);
        border-color: var(--bs-primary);
        outline: none;
    }

/* Auth options */
.form-check {
    display: flex;
    align-items: center;
}

.form-check-input {
    margin-right: var(--bs-spacing-sm);
}

    .form-check-input:checked {
        background-color: var(--bs-primary);
        border-color: var(--bs-primary);
    }

/* Button styles */
.login-button {
    height: var(--bs-input-height);
    background-color: var(--bs-primary);
    border: none;
    border-radius: var(--bs-border-radius-sm);
    font-weight: 500;
    width: 100%;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

    .login-button:hover {
        background-color: var(--bs-primary-hover);
    }

/* Secondary buttons */
.btn-outline-secondary {
    border-radius: var(--bs-border-radius-sm);
    padding: 10px 20px;
    transition: all 0.3s ease;
}

    .btn-outline-secondary:hover {
        background-color: var(--bs-text-muted);
        color: white;
    }

/* ==========================================================================
   5. Message Styles
   ========================================================================== */

/* Error message styles */
#error-message,
.error-message {
    -width: 90%;
    align-content: center;
    text-align: center;
    -font-weight: 600;
    color: var(--color-error);
    background-color: var(--color-error-bg);
    border: 1px solid var(--color-error-border);
    padding: 2%;
    border-radius: var(--bs-border-radius-sm);
    display: block; 
}

    #error-message h4 {
        font-weight: 600;
        text-align: center;
        margin-bottom: 0.15rem;
    }

    #error-message span,
    .error-message span {
        display: block;
        text-align: center;
    }

/* Success message styles */
.success-message {
    text-align: center;
    padding: var(--bs-spacing);
    color: var(--color-success);
    background-color: var(--color-success-bg);
    border: 1px solid var(--color-success-border);
    border-radius: var(--bs-border-radius-sm);
    margin-bottom: var(--bs-spacing);
    display: block;
}

    .success-message span {
        display: block;
        text-align: center;
        font-weight: 600;
    }

/* ==========================================================================
   6. Input Type Specific Styles
   ========================================================================== */
input[type='email'] {
    color: black !important;
    background-color: #ffffff !important;
    border: 1px solid rgb(196, 196, 196) !important;
}

input[type='text'] {
    color: black !important;
    background-color: #ffffff !important;
    border: 1px solid rgb(196, 196, 196) !important;
}

input[type='password'] {
    color: black !important;
    background-color: #ffffff !important;
    border: 1px solid rgb(196, 196, 196) !important;
}

input[type='checkbox'] {
    width: 20px !important;
    height: 20px !important;
    accent-color: #4c84ff !important;
    border: 1px solid rgb(196, 196, 196) !important;
    background-color: #ffffff !important;
}

    input[type='checkbox']:checked {
        background-color: #4c84ff !important;
        border-color: #4c84ff !important;
        accent-color: white !important;
    }

input[type='email']:focus,
input[type='text']:focus,
input[type='password']:focus {
    border-color: #4c84ff !important;
    box-shadow: 0 0 5px rgba(76, 132, 255, 0.5) !important;
    outline: none;
}

/* ==========================================================================
   7. Responsive Styles
   ========================================================================== */

/* Large tablets and desktop */
@media (min-width: 992px) {
    .left-column,
    .right-column {
        padding: var(--bs-spacing-xxl);
    }
}

/* Medium devices (tablets) */
@media (max-width: 991.98px) {
    .auth-card {
        max-width: 90%;
    }
}

/* Tablet in portrait mode (768px-992px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    body {
        align-items: center;
        padding-top: 0;
    }

    .container {
        padding: var(--bs-spacing);
        justify-content: center;
        align-items: center;
    }

    .left-column,
    .right-column {
        padding: var(--bs-spacing-md);
    }

    .d-flex {
        flex-direction: row;
        align-items: center;
    }

    .form-check {
        margin-bottom: 0;
    }

    a {
        margin-top: 0;
    }
}

/* Small devices (landscape phones and small tablets) */
@media (max-width: 767.98px) {
    body {
        align-items: flex-start;
        padding-top: var(--bs-spacing-lg);
    }

    .auth-card {
        max-width: 95%;
        flex-direction: column;
    }

    .left-column {
        text-align: left;
        padding: var(--bs-spacing-md);
    }

    .feature-item {
        justify-content: left;
    }

    .right-column {
        padding: var(--bs-spacing-md);
    }

    .d-flex {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-check {
        margin-bottom: var(--bs-spacing-sm);
    }

    .form-check-input {
        margin-right: var(--bs-spacing-sm);
    }

    .form-check-label {
        font-size: 0.875rem;
    }

    a {
        margin-top: var(--bs-spacing-sm);
    }
}

/* Extra small devices (portrait phones) */
@media (max-width: 575.98px) {
    body {
        padding-top: 0;
    }

    .container {
        padding: 0;
    }

    .auth-card {
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    .left-column,
    .right-column {
        padding: var(--bs-spacing);
    }

    .right-column {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }

    /* Logo and title */
    .text-center {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    /* Form */
    form {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .input-icon input {
        flex-grow: 1;
    }

    .login-button {
        margin-top: 10px;
    }

    #username-divider .divider-text-container {
        position: static;
        transform: none;
        text-align: center;
        margin-top: var(--bs-spacing-sm);
        background: transparent;
    }

    #username-divider hr {
        margin-bottom: var(--bs-spacing-sm);
    }

    .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-check {
        margin-bottom: var(--bs-spacing-sm);
    }

    .auth-card img {
        max-width: 100%;
        height: auto;
    }
}
