/* Secret Code Login Page Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(192, 132, 252, 0.2);
    tap-highlight-color: rgba(192, 132, 252, 0.2);
}

:root {
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
    --primary-pink: #ff6b9d;
    --primary-purple: #c084fc;
    --primary-lavender: #ddd6fe;
    --primary-gold: #fbbf24;
    --rose-red: #fb7185;
    --white: #ffffff;
    --error-soft: #f87171;
    --shadow-soft: rgba(192, 132, 252, 0.25);
    --shadow-strong: rgba(192, 132, 252, 0.4);
    --gradient-primary: linear-gradient(135deg, #c084fc 0%, #ff6b9d 100%);
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    background: linear-gradient(135deg, #fae8ff 0%, #fce7f3 25%, #ddd6fe 50%, #fbcfe8 75%, #fae8ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 30%, rgba(192, 132, 252, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(251, 113, 133, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Floating Hearts Background */
.floating-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.floating-hearts::before,
.floating-hearts::after {
    content: '💖';
    position: absolute;
    font-size: 30px;
    opacity: 0;
    animation: float 15s infinite;
}

.floating-hearts::before {
    left: 20%;
    animation-delay: 0s;
}

.floating-hearts::after {
    content: '💕';
    left: 70%;
    animation-delay: 7s;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Login Container */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
    border-radius: 30px;
    padding: 50px 40px;
    box-shadow: 0 25px 70px var(--shadow-strong);
    border: 1px solid rgba(255, 255, 255, 0.8);
    animation: slideIn 0.8s ease-out;
    position: relative;
}

.login-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 30px;
    padding: 2px;
    background: var(--gradient-primary);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.4;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lock-icon {
    font-size: 60px;
    text-align: center;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lock-icon i {
    display: inline-block;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

.title {
    text-align: center;
    font-size: 32px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    text-align: center;
    color: var(--primary-purple);
    font-size: 16px;
    margin-bottom: 40px;
    font-weight: 500;
}

/* Form Styles */
.login-form {
    width: 100%;
}

.input-group {
    position: relative;
    margin-bottom: 30px;
}

.input-group input {
    width: 100%;
    padding: 18px 50px 18px 20px;
    border: 2px solid rgba(192, 132, 252, 0.2);
    border-radius: 15px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-dark);
    font-weight: 500;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-purple);
    background: white;
    box-shadow: 0 8px 30px rgba(192, 132, 252, 0.25);
    transform: translateY(-2px);
}

.input-group input::placeholder {
    color: var(--text-light);
}

.input-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: #d4a5ff;
}

.submit-btn {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 15px;
    background: var(--gradient-primary);
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px var(--shadow-strong);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px var(--shadow-strong);
}

.submit-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 20px;
    animation: sparkle 1.5s infinite;
}

@keyframes sparkle {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
    }
}

/* Error Message */
.error-message {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(248, 113, 113, 0.1));
    border: 2px solid var(--error-soft);
    border-radius: 12px;
    color: #dc2626;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* Loading State */
.submit-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.submit-btn.loading .btn-text::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success Animation */
@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 20px 50px rgba(212, 165, 255, 0.6);
    }
    100% {
        transform: scale(1);
    }
}

.submit-btn.success {
    animation: successPulse 0.5s ease;
}

/* Responsive Design */

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .login-container {
        padding: 30px;
    }
    
    .login-card {
        max-width: 500px;
        padding: 55px 45px;
    }
    
    .lock-icon {
        font-size: 65px;
    }
    
    .title {
        font-size: 34px;
    }
}

/* Mobile Landscape (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .login-container {
        padding: 25px;
    }
    
    .login-card {
        padding: 45px 35px;
    }
    
    .lock-icon {
        font-size: 55px;
    }
    
    .title {
        font-size: 30px;
    }
    
    .subtitle {
        font-size: 15px;
        margin-bottom: 35px;
    }
    
    .input-group input {
        padding: 16px 45px 16px 18px;
        font-size: 15px;
    }
    
    .submit-btn {
        padding: 16px;
        font-size: 17px;
    }
}

/* Mobile Portrait (up to 575px) */
@media (max-width: 575px) {
    body {
        padding: 0;
    }
    
    .login-container {
        padding: 20px;
        align-items: flex-start;
        padding-top: 10vh;
    }
    
    .login-card {
        padding: 40px 30px;
        border-radius: 25px;
    }
    
    .lock-icon {
        font-size: 50px;
        margin-bottom: 15px;
    }
    
    .title {
        font-size: 28px;
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: 14px;
        margin-bottom: 30px;
    }
    
    .input-group {
        margin-bottom: 25px;
    }
    
    .input-group input {
        padding: 15px 45px 15px 16px;
        font-size: 15px;
        border-radius: 12px;
    }
    
    .input-icon {
        right: 15px;
        font-size: 20px;
    }
    
    .submit-btn {
        padding: 15px;
        font-size: 16px;
        border-radius: 12px;
    }
    
    .error-message {
        font-size: 13px;
        padding: 12px;
    }
}

/* Extra Small Mobile (up to 375px) */
@media (max-width: 375px) {
    .login-container {
        padding: 15px;
        padding-top: 8vh;
    }
    
    .login-card {
        padding: 35px 25px;
    }
    
    .lock-icon {
        font-size: 45px;
    }
    
    .title {
        font-size: 26px;
    }
    
    .subtitle {
        font-size: 13px;
    }
    
    .input-group input {
        padding: 14px 42px 14px 14px;
        font-size: 14px;
    }
    
    .submit-btn {
        padding: 14px;
        font-size: 15px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .submit-btn {
        min-height: 50px;
    }
    
    .input-group input {
        min-height: 50px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Disable hover effects on touch */
    .submit-btn:hover {
        transform: none;
    }
}

/* Landscape Mode */
@media (max-height: 500px) and (orientation: landscape) {
    .login-container {
        padding: 15px;
        align-items: center;
    }
    
    .login-card {
        padding: 30px 40px;
        max-width: 600px;
    }
    
    .lock-icon {
        font-size: 40px;
        margin-bottom: 10px;
    }
    
    .title {
        font-size: 24px;
    }
    
    .subtitle {
        margin-bottom: 20px;
    }
    
    .input-group {
        margin-bottom: 15px;
    }
}
