/* Login Page Specific Styles */

.login-page {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation for login page */
.login-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding: 1rem 0;
}

.login-nav .nav-logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.login-nav .nav-logo h2 {
    color: var(--primary-dark);
    margin: 0;
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--primary-dark);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 300;
}

.nav-links .nav-link:hover {
    background: var(--gold);
    color: white;
    transform: translateY(-1px);
}

/* Main login container */
.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1200px;
    width: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 500px;
}

/* Visual section */
.login-visual {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: white;
}

.visual-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.brand-section {
    margin-bottom: 2rem;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
    filter: brightness(0) invert(1);
}

.visual-content h1 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: var(--gold);
}

.visual-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

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

.highlight-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
}

.highlight-icon {
    width: 50px;
    height: 50px;
    background: rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.highlight-icon i {
    color: var(--gold);
    font-size: 1.2rem;
}

.highlight-text h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: white;
}

.highlight-text p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
}

/* Geometric background */
.geometric-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-shape {
    position: absolute;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 50%;
}

.bg-shape.shape-1 {
    width: 200px;
    height: 200px;
    top: -50px;
    right: -50px;
    animation: float 6s ease-in-out infinite;
}

.bg-shape.shape-2 {
    width: 150px;
    height: 150px;
    bottom: -75px;
    left: -75px;
    animation: float 8s ease-in-out infinite reverse;
}

.bg-shape.shape-3 {
    width: 100px;
    height: 100px;
    top: 50%;
    left: 20px;
    animation: float 7s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Form section */
.login-form-section {
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.form-container {
    width: 100%;
    max-width: 400px;
}

.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.form-header h2 {
    color: var(--primary-dark);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.form-header p {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

/* Form styling */
.login-form {
    margin-bottom: 2rem;
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group label i {
    color: var(--gold);
    width: 16px;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: var(--primary-dark);
}

.form-group input:focus {
    outline: none;
    border-color: var(--gold);
    background: white;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.3s ease;
}

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

.input-focus-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.3s ease;
}

.form-group input:focus + .input-focus-line {
    width: 100%;
}

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

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
}

.checkbox-container input {
    opacity: 0;
    position: absolute;
    cursor: pointer;
}

.checkmark {
    height: 18px;
    width: 18px;
    background-color: #eee;
    border-radius: 4px;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: #ccc;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--gold);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 3px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-link {
    color: var(--gold);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--gold-dark);
}

.btn-login {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
}

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

/* Demo section */
.demo-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.demo-divider {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.demo-divider span {
    background: white;
    padding: 0 1rem;
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.demo-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e9ecef;
    z-index: -1;
}

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

.demo-card {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--gold);
}

.demo-card h4 {
    margin: 0 0 0.75rem 0;
    color: var(--primary-dark);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.demo-card h4 i {
    color: var(--gold);
}

.credential-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.credential-row:last-child {
    margin-bottom: 0;
}

.label {
    color: #666;
    font-weight: 400;
}

.value {
    font-family: 'Courier New', monospace;
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: var(--primary-dark);
    font-weight: 500;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--gold);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: var(--gold);
    color: white;
}

/* Login footer */
.login-footer {
    margin-top: 2rem;
    text-align: center;
}

.login-footer p {
    margin: 0.5rem 0;
    font-size: 0.85rem;
    color: #666;
}

.login-footer a {
    color: var(--gold);
    text-decoration: none;
}

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

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #28a745 !important;
}

.security-note i {
    color: #28a745;
}

/* =========================== */
/* LOGIN PAGE RESPONSIVE DESIGN */
/* =========================== */

/* Large Desktop (1400px and up) */
@media (min-width: 1400px) {
    .login-container {
        max-width: 1300px;
    }

    .visual-content h1 {
        font-size: 2.5rem;
    }

    .login-logo {
        width: 100px;
        height: 100px;
    }
}

/* Desktop (1200px to 1399px) */
@media (max-width: 1399px) and (min-width: 1200px) {
    .login-container {
        max-width: 1100px;
    }
}

/* Desktop Small (992px to 1199px) */
@media (max-width: 1199px) and (min-width: 992px) {
    .login-container {
        max-width: 900px;
    }

    .visual-content h1 {
        font-size: 2rem;
    }

    .login-visual {
        padding: 2.5rem;
    }

    .login-form-section {
        padding: 2.5rem;
    }
}

/* Tablet Landscape (768px to 991px) */
@media (max-width: 991px) and (min-width: 768px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 600px;
        min-height: 600px;
    }

    .login-visual {
        padding: 2rem;
        order: 1;
    }

    .login-form-section {
        padding: 2rem;
        order: 2;
    }

    .platform-highlights {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .highlight-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .visual-content h1 {
        font-size: 1.8rem;
    }

    .brand-section {
        margin-bottom: 1.5rem;
    }

    .demo-credentials {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Tablet Portrait (576px to 767px) */
@media (max-width: 767px) and (min-width: 576px) {
    .login-main {
        padding: 1.5rem;
    }

    .login-container {
        grid-template-columns: 1fr;
        max-width: 500px;
        min-height: auto;
        border-radius: 16px;
    }

    .login-visual {
        padding: 1.5rem;
        order: 1;
    }

    .login-form-section {
        padding: 1.5rem;
        order: 2;
    }

    .platform-highlights {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .highlight-item {
        flex-direction: row;
        text-align: left;
        gap: 1rem;
        justify-content: flex-start;
    }

    .visual-content h1 {
        font-size: 1.6rem;
    }

    .visual-content p {
        font-size: 1rem;
    }

    .login-logo {
        width: 60px;
        height: 60px;
    }

    .brand-section {
        margin-bottom: 1.5rem;
    }

    .form-header h2 {
        font-size: 1.8rem;
    }

    .form-container {
        max-width: 100%;
    }

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

    .credential-row {
        align-items: center;
        gap: 0.5rem;
    }

    .nav-links .nav-link span {
        display: inline;
    }
}

/* Mobile (max-width: 575px) */
@media (max-width: 575px) {
    /* Aggressive overflow prevention */
    html, body {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    * {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    .login-page {
        background: var(--primary-light);
        max-width: 100vw;
        overflow-x: hidden;
    }

    .login-main {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 2rem;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .login-container {
        grid-template-columns: 1fr;
        max-width: 100%;
        min-height: auto;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }

    .login-visual {
        padding: 1.5rem;
        background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 50%, var(--primary-dark) 100%);
    }

    .login-form-section {
        padding: 1.5rem;
    }

    .platform-highlights {
        display: none; /* Hide highlights on mobile to save space */
    }

    .brand-section {
        margin-bottom: 1rem;
    }

    .visual-content h1 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }

    .visual-content p {
        font-size: 0.9rem;
        margin-bottom: 0;
    }

    .login-logo {
        width: 50px;
        height: 50px;
        margin-bottom: 1rem;
    }

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

    .form-header h2 {
        font-size: 1.6rem;
        margin-bottom: 0.5rem;
    }

    .form-header p {
        font-size: 0.9rem;
    }

    .form-container {
        max-width: 100%;
    }

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

    .form-group label {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }

    .form-group input {
        padding: 0.875rem;
        font-size: 0.9rem;
    }

    .btn-login {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }

    .demo-section {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }

    .demo-credentials {
        gap: 0.75rem;
    }

    .demo-card {
        padding: 0.875rem;
    }

    .demo-card h4 {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }

    .credential-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        margin-bottom: 0.4rem;
    }

    .credential-row:last-child {
        margin-bottom: 0;
    }

    .value {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }

    .copy-btn {
        align-self: flex-end;
        margin-top: 0.25rem;
        font-size: 0.8rem;
        padding: 0.2rem;
    }

    .login-footer {
        margin-top: 1.5rem;
    }

    .login-footer p {
        font-size: 0.8rem;
    }

    /* Navigation adjustments */
    .nav-container {
        padding: 0 1rem;
        height: 70px;
    }

    .nav-logo h2 {
        font-size: 1.2rem;
    }

    .logo-img {
        width: 30px;
        height: 30px;
    }

    .nav-links .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .nav-links .nav-link span {
        display: none; /* Hide text on mobile, keep icon */
    }

    .nav-links .nav-link i {
        font-size: 1rem;
    }

    .geometric-bg {
        opacity: 0.3; /* Reduce visual complexity on mobile */
    }
}

/* Mobile Small (max-width: 400px) */
@media (max-width: 400px) {
    .login-main {
        padding: 0.75rem;
        padding-top: 1rem;
        min-height: 100vh;
        align-items: stretch;
    }

    .login-container {
        border-radius: 8px;
        margin: 0;
        max-width: 100%;
        min-height: calc(100vh - 1.5rem);
    }

    .login-visual {
        padding: 1rem;
        min-height: auto;
    }

    .login-form-section {
        padding: 1rem;
        flex: 1;
    }

    .visual-content h1 {
        font-size: 1.2rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }

    .visual-content p {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .login-logo {
        width: 40px;
        height: 40px;
    }

    .form-header h2 {
        font-size: 1.4rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }

    .form-header p {
        font-size: 0.85rem;
        line-height: 1.4;
    }

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

    .form-group input {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    .btn-login {
        padding: 0.75rem 1.25rem;
        font-size: 0.85rem;
    }

    .demo-card {
        padding: 0.75rem;
    }

    .demo-card h4 {
        font-size: 0.8rem;
    }

    .credential-row {
        font-size: 0.75rem;
    }

    .value {
        font-size: 0.75rem;
        padding: 0.15rem 0.3rem;
    }

    .copy-btn {
        font-size: 0.75rem;
        padding: 0.15rem;
    }

    .login-footer p {
        font-size: 0.75rem;
    }

    /* Navigation */
    .nav-container {
        padding: 0 0.75rem;
        height: 60px;
    }

    .nav-logo h2 {
        font-size: 1rem;
    }

    .logo-img {
        width: 25px;
        height: 25px;
    }

    .nav-links .nav-link {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .login-main {
        align-items: center;
        padding: 1rem;
    }

    .login-container {
        min-height: auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .login-visual {
        padding: 1rem;
    }

    .login-form-section {
        padding: 1rem;
    }

    .brand-section {
        margin-bottom: 0.5rem;
    }

    .visual-content h1 {
        font-size: 1.2rem;
        margin-bottom: 0.25rem;
    }

    .visual-content p {
        font-size: 0.8rem;
    }

    .login-logo {
        width: 40px;
        height: 40px;
        margin-bottom: 0.5rem;
    }

    .form-header {
        margin-bottom: 1rem;
    }

    .form-header h2 {
        font-size: 1.4rem;
    }

    .demo-section {
        margin-top: 1rem;
        padding-top: 1rem;
    }

    .platform-highlights {
        display: none;
    }
}

/* Ultra Small Mobile (max-width: 320px) */
@media (max-width: 320px) {
    .login-main {
        padding: 0.5rem;
        padding-top: 0.5rem;
    }

    .login-container {
        border-radius: 6px;
        min-height: calc(100vh - 1rem);
        margin: 0;
        max-width: 100%;
    }

    .login-visual {
        padding: 0.75rem;
    }

    .login-form-section {
        padding: 0.75rem;
    }

    .visual-content h1 {
        font-size: 1.1rem;
        line-height: 1.2;
    }

    .visual-content p {
        font-size: 0.8rem;
    }

    .login-logo {
        width: 36px;
        height: 36px;
    }

    .form-header h2 {
        font-size: 1.3rem;
    }

    .form-header p {
        font-size: 0.8rem;
    }

    .form-group input {
        padding: 0.7rem;
        font-size: 0.8rem;
        min-height: 44px;
    }

    .login-button {
        padding: 0.75rem;
        font-size: 0.9rem;
        min-height: 44px;
    }

    .nav-container {
        padding: 0 0.5rem;
        height: 60px;
    }

    .nav-brand {
        font-size: 0.9rem;
    }

    .nav-logo {
        width: 24px;
        height: 24px;
    }

    .nav-actions .nav-link {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .login-logo,
    .logo-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print styles for login page */
@media print {
    .login-page {
        background: white;
    }

    .login-visual,
    .nav-links,
    .geometric-bg,
    .bg-shape {
        display: none;
    }

    .login-container {
        box-shadow: none;
        border: 1px solid #ccc;
        grid-template-columns: 1fr;
    }

    .login-form-section {
        padding: 1rem;
    }

    .demo-section {
        page-break-before: always;
    }
}