/* login_page.css - MOBILE OPTIMIZED VERSION */
:root {
    --purple: #975ab7;
    --brown: #502325;
    --purple-light: #b388d1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* Prevent iOS bounce scrolling */
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%; /* Prevent font size adjustment on orientation change */
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--purple);
    color: var(--brown);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh; /* Use dynamic viewport height for mobile */
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

body::before {
    content: '';
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(151, 90, 183, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(80, 35, 37, 0.3) 0%, transparent 50%);
    z-index: -1;
    /* Disable animation on mobile for performance */
}

/* Desktop-only animation */
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
    body::before {
        animation: gradientShift 20s ease infinite;
    }
}

@keyframes gradientShift {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.login-wrapper {
    width: 100%;
    max-width: 1000px;
    min-height: 700px;
    display: flex;
    background: rgba(80, 35, 37, 0.7);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    border-radius: 20px;
    overflow: hidden;
}

.form-column {
    flex-basis: 55%;
    padding: 30px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.branding-column {
    flex-basis: 45%;
    background-image: url('https://images.pexels.com/photos/45202/brownie-dessert-cake-sweet-45202.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
}

.branding-column::after {
    content: '';
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background-color: rgba(80, 35, 37, 0.5);
}

.branding-logo {
    width: 200px;
    max-width: 80%;
    height: auto;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.5));
}

.login-container {
    width: 100%;
    max-width: 450px;
    color: white;
}

.login-header { 
    padding: 20px 0; 
    text-align: center; 
}

.tabs { 
    margin: 0 0 30px 0; 
    padding: 0; 
    background: none; 
    display: flex; 
    border-bottom: 2px solid rgba(255, 255, 255, 0.1); 
}

.form-section { 
    padding: 0; 
}

.login-header .logo-icon { 
    font-size: 3rem;
    line-height: 1;
}

.login-header h1 { 
    font-family: 'Playfair Display', serif; 
    font-size: 2rem;
    line-height: 1.2;
    margin: 10px 0;
    background: linear-gradient(135deg, #ffffff, #e6d3f7); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    background-clip: text; 
}

.login-header p { 
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

.tab-btn { 
    flex: 1; 
    background: transparent; 
    border: none; 
    border-bottom: 3px solid transparent; 
    color: rgba(255, 255, 255, 0.6); 
    font-size: 1rem;
    font-weight: 500; 
    padding: 15px 0;
    cursor: pointer; 
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    /* Minimum touch target */
    min-height: 44px;
}

.tab-btn:hover { 
    color: white; 
}

.tab-btn.active { 
    color: white; 
    font-weight: bold; 
    border-bottom-color: var(--purple-light); 
}

.tab-btn:active {
    transform: scale(0.98);
}

.form-content { 
    display: none; 
}

.form-content.active { 
    display: block; 
    animation: formSlideIn 0.6s ease; 
}

@keyframes formSlideIn { 
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    } 
    to { 
        opacity: 1; 
        transform: translateY(0); 
    } 
}

/* Disable animations for reduced motion */
@media (prefers-reduced-motion: reduce) {
    @keyframes formSlideIn { 
        from { opacity: 0; } 
        to { opacity: 1; } 
    }
}

.input-group { 
    margin-bottom: 20px; 
}

.input-group label { 
    display: block; 
    font-size: 0.9rem; 
    color: rgba(255, 255, 255, 0.8); 
    margin-bottom: 8px;
    line-height: 1.4;
}

.input-wrapper { 
    position: relative; 
}

.input-wrapper i { 
    position: absolute; 
    left: 20px; 
    top: 50%; 
    transform: translateY(-50%); 
    color: var(--purple-light);
    pointer-events: none; /* Prevent blocking input clicks */
}

.input-wrapper input { 
    width: 100%; 
    padding: 15px 20px 15px 50px; 
    background: linear-gradient(145deg, rgba(0,0,0,0.3), rgba(0,0,0,0.15)); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    border-radius: 12px; 
    color: white; 
    font-size: 16px; /* Prevent zoom on iOS */
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    /* Minimum touch target height */
    min-height: 48px;
}

.input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-wrapper input:focus { 
    outline: none; 
    border-color: var(--purple); 
    box-shadow: 0 0 15px rgba(151, 90, 183, 0.5); 
    background: linear-gradient(145deg, rgba(0,0,0,0.4), rgba(0,0,0,0.2));
}

.forgot-link { 
    text-align: right; 
    margin-top: 10px; 
}

.forgot-link a { 
    color: var(--purple-light); 
    text-decoration: none; 
    font-size: 0.9rem;
    /* Make link larger for easier tapping */
    display: inline-block;
    padding: 5px;
    min-height: 44px;
    line-height: 34px;
    -webkit-tap-highlight-color: transparent;
}

.forgot-link a:active {
    opacity: 0.7;
}

.btn-primary { 
    width: 100%; 
    padding: 16px; 
    margin-top: 20px; 
    border-radius: 50px; 
    font-weight: bold; 
    font-size: 16px; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    cursor: pointer; 
    border: 1px solid var(--purple); 
    background: linear-gradient(145deg, var(--purple), #6d4087); 
    color: white;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    /* Minimum touch target */
    min-height: 48px;
    -webkit-appearance: none;
    appearance: none;
}

.btn-primary:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* Desktop hover effects */
@media (min-width: 901px) and (hover: hover) {
    .btn-primary:hover {
        background: linear-gradient(145deg, var(--purple-light), var(--purple));
        transform: translateY(-2px);
        box-shadow: 0 10px 25px rgba(151, 90, 183, 0.4);
    }
}

.resend-container {
    margin-top: 25px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    line-height: 1.5;
}

#resendOtpBtn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid var(--purple-light);
    color: var(--purple-light);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    /* Minimum touch target */
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#resendOtpBtn:hover {
    background-color: var(--purple-light);
    color: var(--brown);
}

#resendOtpBtn:active {
    transform: scale(0.98);
}

#resendOtpBtn:disabled {
    color: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    background: transparent;
    text-decoration: none;
    opacity: 0.6;
}

.message { 
    margin-top: 20px; 
    font-size: 14px; 
    line-height: 1.5;
    padding: 12px 18px; 
    border-radius: 8px; 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    display: none; 
}

.message.show { 
    display: block; 
}

.message.success { 
    background: rgba(46, 204, 113, 0.2); 
    border-color: rgba(46, 204, 113, 0.5); 
    color: #a3ffc9; 
}

.message.error { 
    background: rgba(231, 76, 60, 0.2); 
    border-color: rgba(231, 76, 60, 0.5); 
    color: #ffc2bb; 
}

/* ======================================= */
/* RESPONSIVE BREAKPOINTS */
/* ======================================= */

/* Tablets and below - Switch to single column */
@media (max-width: 900px) {
    body {
        align-items: flex-start;
        padding: 10px;
    }
    
    .login-wrapper {
        flex-direction: column;
        min-height: 0;
        max-width: 500px;
        margin-top: 5vh;
        margin-bottom: 5vh;
    }
    
    .branding-column {
        display: none;
    }
    
    .form-column {
        flex-basis: 100%;
        padding: 30px 25px;
    }
    
    .login-header .logo-icon {
        font-size: 2.5rem;
    }
    
    .login-header h1 {
        font-size: 1.8rem;
    }
}

/* Small tablets and large phones */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }
    
    .login-wrapper {
        border-radius: 15px;
        margin-top: 2vh;
    }
    
    .form-column {
        padding: 25px 20px;
    }
    
    .login-header {
        padding: 15px 0;
    }
    
    .login-header .logo-icon {
        font-size: 2.2rem;
    }
    
    .login-header h1 {
        font-size: 1.6rem;
    }
    
    .tab-btn {
        font-size: 0.95rem;
        padding: 12px 0;
    }
    
    .tabs {
        margin-bottom: 25px;
    }
    
    .input-wrapper input {
        padding: 14px 18px 14px 48px;
        font-size: 15px;
    }
    
    .btn-primary {
        padding: 15px;
        font-size: 15px;
    }
}

/* Standard phones */
@media (max-width: 480px) {
    .login-wrapper {
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    }
    
    .form-column {
        padding: 20px 15px;
    }
    
    .login-header .logo-icon {
        font-size: 2rem;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .login-header p {
        font-size: 0.9rem;
    }
    
    .tab-btn {
        font-size: 0.9rem;
        padding: 10px 0;
    }
    
    .input-group {
        margin-bottom: 15px;
    }
    
    .input-group label {
        font-size: 0.85rem;
    }
    
    .input-wrapper input {
        padding: 13px 16px 13px 45px;
        font-size: 15px;
        border-radius: 10px;
    }
    
    .input-wrapper i {
        left: 16px;
        font-size: 0.9rem;
    }
    
    .btn-primary {
        padding: 14px;
        font-size: 14px;
        margin-top: 15px;
    }
    
    .resend-container {
        font-size: 0.85em;
        margin-top: 20px;
    }
    
    #resendOtpBtn {
        padding: 6px 14px;
        font-size: 0.85rem;
    }
    
    .message {
        font-size: 13px;
        padding: 10px 14px;
    }
}

/* Small phones */
@media (max-width: 360px) {
    body {
        padding: 0;
    }
    
    .login-wrapper {
        border-radius: 8px;
        margin-top: 0;
        margin-bottom: 0;
        min-height: 100vh;
        min-height: 100dvh;
    }
    
    .form-column {
        padding: 15px 12px;
    }
    
    .login-header .logo-icon {
        font-size: 1.8rem;
    }
    
    .login-header h1 {
        font-size: 1.3rem;
    }
    
    .login-header p {
        font-size: 0.85rem;
    }
    
    .tab-btn {
        font-size: 0.85rem;
        padding: 10px 0;
    }
    
    .input-wrapper input {
        padding: 12px 14px 12px 42px;
        font-size: 14px;
    }
    
    .input-wrapper i {
        left: 14px;
        font-size: 0.85rem;
    }
    
    .btn-primary {
        padding: 13px;
        font-size: 13px;
    }
    
    #resendOtpBtn {
        padding: 5px 12px;
        font-size: 0.8rem;
    }
}

/* Landscape orientation on small devices */
@media (max-width: 900px) and (orientation: landscape) {
    body {
        align-items: flex-start;
    }
    
    .login-wrapper {
        margin-top: 2vh;
        margin-bottom: 2vh;
        min-height: 0;
    }
    
    .login-header {
        padding: 10px 0;
    }
    
    .login-header .logo-icon {
        font-size: 2rem;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .tabs {
        margin-bottom: 20px;
    }
    
    .input-group {
        margin-bottom: 12px;
    }
    
    .btn-primary {
        margin-top: 15px;
    }
}

/* iOS Safe Area Support */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .form-column {
        padding-bottom: calc(30px + env(safe-area-inset-bottom));
    }
}

/* High DPI displays optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .login-wrapper {
        backdrop-filter: blur(10px); /* Reduce blur on high DPI for better performance */
    }
}

/* Prevent zoom on inputs for iOS */
@media (max-width: 900px) {
    input,
    textarea,
    select,
    button {
        font-size: 16px !important;
    }
}