/* ================================================
   INFLIBNET Services Authentication Styles
   Login & Registration Pages - Common CSS
   ================================================ */

/* ========== CSS Variables ========== */
:root {
    /* INFLIBNET Color Palette - Professional Blue & Green Theme */
    --inflibnet-primary: #1565c0;        /* Professional Blue */
    --inflibnet-primary-light: #42a5f5;  /* Light Blue */
    --inflibnet-primary-dark: #0d47a1;   /* Deep Blue */
    --inflibnet-secondary: #2e7d32;      /* Professional Green */
    --inflibnet-secondary-light: #66bb6a;/* Light Green */
    --inflibnet-secondary-dark: #1b5e20; /* Dark Green */
    --inflibnet-accent: #0288d1;         /* Accent Blue */
    --inflibnet-info: #0097a7;           /* Teal */
    --inflibnet-dark: #263238;           /* Blue Gray Dark */
    --inflibnet-light: #eceff1;          /* Blue Gray Light */
    --inflibnet-white: #ffffff;
    --inflibnet-success: #43a047;        /* Success Green */
}

/* ========== Base Styles ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #f1f8fb 100%);
    min-height: 100vh;
}

/* ========== Auth Wrapper ========== */
.auth-wrapper {
    min-height: 100vh;
}

/* ========== Auth Card ========== */
.auth-card {
    border-radius: 24px;
    border: none;
    overflow: hidden;
    background: white;
}

/* ========== Auth Banner (Left Side) ========== */
.auth-banner {
    position: relative;
    padding: 60px 40px;
}

.auth-logo {
    max-width: 240px;
    filter: brightness(0) invert(1);
}

.auth-logo-mobile {
    max-width: 180px;
}

.auth-illustration {
    margin-top: 40px;
}

/* ========== Auth Form Wrapper ========== */
.auth-form-wrapper {
    background: white;
}

.auth-header h3 {
    font-size: 28px;
    color: var(--inflibnet-dark);
}

.auth-header p {
    font-size: 14px;
    color: #6c757d;
}

/* ========== Form Inputs ========== */
.auth-input {
    padding: 12px 16px;
    font-size: 14px;
    border-color: #e9ecef;
    transition: all 0.3s ease;
}

.auth-input:focus {
    border-color: var(--inflibnet-primary);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
    outline: none;
}

.input-group-text {
    border-color: #e9ecef;
    transition: all 0.3s ease;
    background-color: white;
}

.input-group:focus-within .input-group-text {
    border-color: var(--inflibnet-primary);
    background-color: #e3f2fd !important;
}

/* ========== Password Toggle Button ========== */
.password-toggle {
    border-color: #e9ecef;
    background: white;
    color: #6c757d;
    transition: all 0.3s ease;
}

.password-toggle:hover {
    color: var(--inflibnet-primary);
    background: #e3f2fd;
    border-color: #e9ecef;
}

.password-toggle:focus {
    box-shadow: none;
    border-color: var(--inflibnet-primary);
}

.password-toggle:active {
    background: #bbdefb;
}

/* ========== Primary Button ========== */
.btn-vm-primary {
    background: linear-gradient(135deg, var(--inflibnet-primary) 0%, var(--inflibnet-primary-light) 100%);
    border: none;
    color: white;
    border-radius: 12px;
    padding: 14px 24px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.3);
    transition: all 0.3s ease;
}

.btn-vm-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(21, 101, 192, 0.4);
    color: white;
    background: linear-gradient(135deg, var(--inflibnet-primary-dark) 0%, var(--inflibnet-primary) 100%);
}

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

.btn-vm-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ========== Social Login Buttons ========== */
.social-btn {
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    border-color: #dee2e6;
}

.social-btn:hover {
    background: #f8f9fa;
    border-color: var(--inflibnet-primary);
    color: var(--inflibnet-primary);
    transform: translateY(-2px);
}

/* ========== Divider ========== */
.auth-divider {
    position: relative;
    text-align: center;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: #e9ecef;
}

.auth-divider-text {
    position: relative;
    background: white;
    padding: 0 20px;
    color: #6c757d;
    font-size: 13px;
    font-weight: 500;
}

/* ========== Form Check (Checkbox & Radio) ========== */
.form-check-input {
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--inflibnet-primary);
    border-color: var(--inflibnet-primary);
}

.form-check-input:focus {
    border-color: var(--inflibnet-primary);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
}

.form-check-label {
    font-size: 14px;
    cursor: pointer;
}

/* ========== Links ========== */
a {
    transition: all 0.3s ease;
}

a:hover {
    color: var(--inflibnet-primary-dark) !important;
}

/* ========== Text Utilities ========== */
.text-vm-primary {
    color: var(--inflibnet-primary) !important;
}

.text-vm-dark {
    color: var(--inflibnet-dark) !important;
}

.text-inflibnet-secondary {
    color: var(--inflibnet-secondary) !important;
}

/* ========== Background Utilities ========== */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--inflibnet-primary) 0%, var(--inflibnet-primary-light) 100%) !important;
}

.bg-gradient-dual {
    background: linear-gradient(135deg, var(--inflibnet-primary) 0%, var(--inflibnet-secondary) 100%) !important;
}

/* ========== Shadow Utilities ========== */
.shadow-vm-lg {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12) !important;
}

/* ========== Form Select ========== */
.form-select {
    padding: 12px 16px;
    font-size: 14px;
    border-color: #e9ecef;
    transition: all 0.3s ease;
}

.form-select:focus {
    border-color: var(--inflibnet-primary);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
}

/* ========== Labels ========== */
.form-label {
    font-size: 14px;
    margin-bottom: 8px;
}

/* ========== Small Text ========== */
small {
    font-size: 12px;
}

/* ========== Error Messages ========== */
.auth-error {
    background: #fff5f5;
    border: 1px solid #ffebee;
    color: #d32f2f;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
    animation: slideDown 0.3s ease;
}

.auth-error.show {
    display: block;
}

/* ========== Success Messages ========== */
.auth-success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
    animation: slideDown 0.3s ease;
}

.auth-success.show {
    display: block;
}

/* ========== Slide Down Animation ========== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== Button Loading State ========== */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* ========== Password Strength Indicator ========== */
.password-strength {
    margin-top: 8px;
}

/* ========== INFLIBNET Specific Accent Colors ========== */
.icon-accent-orange {
    color: var(--inflibnet-secondary) !important;
}

.icon-accent-blue {
    color: var(--inflibnet-primary) !important;
}

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

/* Large Devices (Desktops, less than 1200px) */
@media (max-width: 1199.98px) {
    .auth-banner {
        padding: 50px 30px;
    }
}

/* Medium Devices (Tablets, less than 992px) */
@media (max-width: 991.98px) {
    .auth-card {
        border-radius: 16px;
    }

    .auth-form-wrapper {
        padding: 30px 20px !important;
    }

    .auth-header h3 {
        font-size: 24px;
    }

    .auth-banner {
        padding: 40px 30px;
    }
}

/* Small Devices (Mobile landscape, less than 768px) */
@media (max-width: 767.98px) {
    .auth-card {
        margin: 15px;
    }

    .auth-header h3 {
        font-size: 22px;
    }

    .btn-vm-primary {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Extra Small Devices (Mobile portrait, less than 576px) */
@media (max-width: 575.98px) {
    .auth-card {
        margin: 10px;
        border-radius: 12px;
    }

    .auth-form-wrapper {
        padding: 25px 15px !important;
    }

    .auth-header h3 {
        font-size: 20px;
    }

    .auth-header p {
        font-size: 13px;
    }

    .social-btn {
        font-size: 13px;
        padding: 8px 12px;
    }

    .auth-logo-mobile {
        max-width: 140px;
    }

    .auth-input {
        padding: 10px 14px;
        font-size: 13px;
    }

    .form-label {
        font-size: 13px;
    }

    .input-group-text {
        padding: 10px 12px;
    }

    /* CAPTCHA responsive layout for mobile */
    .captcha-box,
    .auth-input {
        height: 45px;
    }

    .input-group {
        height: 45px;
    }

    .captcha-refresh-icon {
        width: 36px;
        height: 36px;
    }

    .captcha-refresh-icon i {
        font-size: 14px;
    }
}

/* ========== Focus Visible (Accessibility) ========== */
*:focus-visible {
    outline: 2px solid var(--inflibnet-primary);
    outline-offset: 2px;
}

/* ========== Smooth Transitions ========== */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== Print Styles ========== */
@media print {
    .auth-wrapper {
        background: white;
    }

    .auth-banner {
        display: none;
    }

    .social-btn,
    .auth-divider {
        display: none;
    }
}

/* ========== Dark Mode Support (Optional) ========== */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}

/* ========== High Contrast Mode (Accessibility) ========== */
@media (prefers-contrast: high) {
    .auth-input,
    .form-select,
    .input-group-text {
        border-width: 2px;
    }

    .btn-vm-primary {
        border: 2px solid var(--inflibnet-primary-dark);
    }
}

/* ========== Reduced Motion (Accessibility) ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== Custom Scrollbar ========== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--inflibnet-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--inflibnet-primary-dark);
}

/* ========== Selection Color ========== */
::selection {
    background: var(--inflibnet-primary);
    color: white;
}

::-moz-selection {
    background: var(--inflibnet-primary);
    color: white;
}

/* ========== Placeholder Styles ========== */
::placeholder {
    color: #adb5bd;
    opacity: 1;
}

:-ms-input-placeholder {
    color: #adb5bd;
}

::-ms-input-placeholder {
    color: #adb5bd;
}

/* ========== INFLIBNET Branding Elements ========== */
.inflibnet-brand-stripe {
    height: 4px;
    background: linear-gradient(90deg, var(--inflibnet-primary) 0%, var(--inflibnet-secondary) 100%);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

/* ========== Form Animation Classes ========== */
.form-animate-init {
    opacity: 0;
    transform: translateY(20px);
}

.form-animate-show {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s ease;
}

/* ========== CAPTCHA Styles ========== */
.captcha-container {
    position: relative;
}

.captcha-box {
    background: #f8f9fa;
    background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
    border: 2px solid #e9ecef !important;
    transition: all 0.3s ease;
    min-height: 50px;
    height: 100%;
}

.captcha-box:hover {
    border-color: var(--inflibnet-primary) !important;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.1);
}

.captcha-box img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

/* CAPTCHA Refresh Icon Button */
.captcha-refresh-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dee2e6;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.captcha-refresh-icon:hover {
    background-color: var(--inflibnet-primary);
    color: white;
    border-color: var(--inflibnet-primary);
    transform: rotate(180deg);
    box-shadow: 0 2px 6px rgba(21, 101, 192, 0.2);
}

.captcha-refresh-icon:active {
    transform: scale(0.9);
}

.captcha-refresh-icon i {
    font-size: 16px;
    transition: transform 0.6s ease;
}

.captcha-refresh-icon i.rotating {
    animation: rotateIcon 0.6s ease-in-out;
}

@keyframes rotateIcon {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Align all elements properly in the row */
.captcha-box,
.captcha-refresh-icon,
.auth-input {
    height: 50px;
}

.input-group {
    height: 50px;
}

.input-group .auth-input,
.input-group .input-group-text {
    height: 100%;
    display: flex;
    align-items: center;
}

.inflibnet-footer {
    background: var(--inflibnet-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 20px;
    text-align: center;
    font-size: 13px;
}

.inflibnet-footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.inflibnet-footer a:hover {
    color: var(--inflibnet-secondary-light) !important;
}