/* iPhone App-like Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 53, 15, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(184, 134, 11, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(147, 51, 234, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #1a202c 0%, #2d3748 25%, #4a5568 50%, #2d3748 75%, #1a202c 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(184, 134, 11, 0.05) 2px, rgba(184, 134, 11, 0.05) 4px),
        repeating-linear-gradient(-45deg, transparent, transparent 2px, rgba(147, 51, 234, 0.03) 2px, rgba(147, 51, 234, 0.03) 4px);
    pointer-events: none;
    z-index: -1;
}

.container {
    background: 
        linear-gradient(135deg, rgba(184, 134, 11, 0.1), rgba(147, 51, 234, 0.1)),
        rgba(26, 32, 44, 0.85);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 24px;
    padding: 40px 30px;
    width: 100%;
    max-width: 400px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(184, 134, 11, 0.3) inset,
        0 1px 0 rgba(255, 215, 0, 0.2) inset,
        0 0 20px rgba(184, 134, 11, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    text-align: center;
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #b8860b, #9333ea, #b8860b, #9333ea);
    border-radius: 26px;
    z-index: -1;
}

.app-icon {
    width: 80px;
    height: 80px;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 215, 0, 0.8), rgba(184, 134, 11, 0.9)),
        linear-gradient(135deg, #b8860b, #cd853f);
    border-radius: 22px;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #2d3748;
    box-shadow: 
        0 15px 35px rgba(184, 134, 11, 0.4),
        0 0 0 2px rgba(255, 215, 0, 0.6) inset,
        0 1px 0 rgba(255, 255, 255, 0.8) inset,
        0 0 20px rgba(255, 215, 0, 0.3);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.5);
}

.app-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, transparent 100%);
    border-radius: 22px 22px 0 0;
}

.app-icon::after {
    content: '✨';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 16px;
    animation: sparkle 2s ease-in-out infinite alternate;
}

@keyframes sparkle {
    0% { opacity: 0.5; transform: scale(0.8) rotate(0deg); }
    100% { opacity: 1; transform: scale(1.2) rotate(180deg); }
}

h1 {
    color: #ffd700;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 30px;
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #ffd700, #b8860b, #ffd700);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

label {
    display: block;
    color: #e2e8f0;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

input[type="password"], input[type="text"] {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid rgba(184, 134, 11, 0.3);
    border-radius: 16px;
    font-size: 16px;
    background: 
        linear-gradient(135deg, rgba(26, 32, 44, 0.8), rgba(45, 55, 72, 0.8));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #e2e8f0;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: 
        0 0 0 1px rgba(255, 215, 0, 0.2) inset,
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(184, 134, 11, 0.1);
}

input[type="password"]::placeholder, input[type="text"]::placeholder {
    color: #a0aec0;
}

input[type="password"]:focus, input[type="text"]:focus {
    outline: none;
    border-color: rgba(255, 215, 0, 0.6);
    background: linear-gradient(135deg, rgba(26, 32, 44, 0.9), rgba(45, 55, 72, 0.9));
    box-shadow: 
        0 0 0 3px rgba(255, 215, 0, 0.2),
        0 0 0 1px rgba(255, 215, 0, 0.4) inset,
        0 4px 8px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 215, 0, 0.2);
    transform: translateY(-1px);
}

.btn {
    width: 100%;
    padding: 18px;
    background: 
        linear-gradient(135deg, rgba(184, 134, 11, 0.9), rgba(147, 51, 234, 0.9)),
        linear-gradient(45deg, #b8860b, #9333ea);
    background-blend-mode: overlay;
    color: #f7fafc;
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 10px 20px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 215, 0, 0.3) inset,
        0 1px 0 rgba(255, 255, 255, 0.2) inset,
        0 0 15px rgba(184, 134, 11, 0.2);
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
    border-radius: 16px 16px 0 0;
    pointer-events: none;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    pointer-events: none;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 215, 0, 0.5) inset,
        0 1px 0 rgba(255, 255, 255, 0.3) inset,
        0 0 25px rgba(255, 215, 0, 0.3);
}

.btn:hover::after {
    width: 100px;
    height: 100px;
}

.btn:active {
    transform: translateY(-1px);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 215, 0, 0.4) inset,
        0 0 15px rgba(184, 134, 11, 0.2);
}

.btn-sesam {
    background: 
        radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.3), transparent 70%),
        linear-gradient(135deg, #b8860b, #cd853f, #daa520, #b8860b);
    background-size: 200% 200%;
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.4),
        0 0 0 2px rgba(255, 215, 0, 0.6) inset,
        0 1px 0 rgba(255, 255, 255, 0.4) inset,
        0 0 30px rgba(255, 215, 0, 0.4);
    font-size: 24px;
    padding: 25px;
    margin-top: 20px;
    color: #2d3748;
    border: 3px solid rgba(255, 215, 0, 0.7);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    animation: goldGlow 4s ease-in-out infinite;
    position: relative;
}

@keyframes goldGlow {
    0%, 100% { 
        background-position: 0% 50%;
        box-shadow: 
            0 12px 24px rgba(0, 0, 0, 0.4),
            0 0 0 2px rgba(255, 215, 0, 0.6) inset,
            0 1px 0 rgba(255, 255, 255, 0.4) inset,
            0 0 30px rgba(255, 215, 0, 0.4);
    }
    50% { 
        background-position: 100% 50%;
        box-shadow: 
            0 12px 24px rgba(0, 0, 0, 0.4),
            0 0 0 2px rgba(255, 215, 0, 0.8) inset,
            0 1px 0 rgba(255, 255, 255, 0.6) inset,
            0 0 40px rgba(255, 215, 0, 0.6);
    }
}

.btn-sesam::before {
    border-radius: 16px 16px 0 0;
}

.btn-sesam::after {
    content: '🧞‍♂️';
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    font-size: 20px;
    animation: float 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(-50%) translateX(0px); }
    50% { transform: translateY(-50%) translateX(-5px); }
}

.btn-sesam:hover {
    box-shadow: 
        0 18px 36px rgba(0, 0, 0, 0.5),
        0 0 0 3px rgba(255, 215, 0, 0.8) inset,
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 0 50px rgba(255, 215, 0, 0.6);
    transform: translateY(-5px) scale(1.02);
}

.logout-btn {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.9), rgba(74, 85, 104, 0.9));
    box-shadow: 
        0 10px 20px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(184, 134, 11, 0.3) inset,
        0 1px 0 rgba(255, 255, 255, 0.1) inset,
        0 0 10px rgba(147, 51, 234, 0.2);
    font-size: 14px;
    padding: 12px 20px;
    width: auto !important;
    margin-top: 40px;
    display: inline-block;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    color: #e2e8f0;
    border: 1px solid rgba(147, 51, 234, 0.3);
}

.logout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    border-radius: 12px 12px 0 0;
    pointer-events: none;
}

.logout-btn:hover {
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(147, 51, 234, 0.5) inset,
        0 1px 0 rgba(255, 255, 255, 0.2) inset,
        0 0 15px rgba(147, 51, 234, 0.3);
}

.flash-messages {
    margin-bottom: 20px;
}

.flash-error {
    background: 
        linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(147, 51, 234, 0.05));
    color: #fed7d7;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(220, 53, 69, 0.3);
    font-size: 14px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        0 0 0 1px rgba(255, 215, 0, 0.2) inset,
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(220, 53, 69, 0.2);
}

.flash-success {
    background: 
        linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(184, 134, 11, 0.1));
    color: #c6f6d5;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(40, 167, 69, 0.3);
    font-size: 14px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        0 0 0 1px rgba(255, 215, 0, 0.2) inset,
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(40, 167, 69, 0.2);
}

.password-hint {
    font-size: 12px;
    color: #a0aec0;
    margin-top: 5px;
    font-style: italic;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.main-content {
    text-align: center;
}

.welcome-text {
    font-size: 20px;
    color: #e2e8f0;
    margin-bottom: 30px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 30px 20px;
        border-radius: 15px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .btn-sesam {
        font-size: 20px;
        padding: 20px;
    }
}

/* Loading state */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.loading {
    position: relative;
    color: transparent !important;
}

.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
