/**
 * Styles for Login Page
 * Contains envelope animation and premium UI elements.
 */

:root {
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --surface-glass: rgba(255, 255, 255, 0.8);
    --border-glass: rgba(255, 255, 255, 0.4);
}

body {
    margin: 0;
    overflow: hidden;
    background: #f1f5f9;
}

.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 1rem;
    overflow: hidden;
}

/* Animated Background Blobs */
.bg-blob {
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--primary-gradient);
    filter: blur(80px);
    opacity: 0.12;
    border-radius: 50%;
    z-index: 0;
    animation: blobFloat 20s infinite alternate;
}

.blob-1 { top: -10%; right: -5%; animation-delay: 0s; }
.blob-2 { bottom: -10%; left: -5%; animation-delay: -5s; }
.blob-3 { top: 40%; left: 10%; width: 250px; height: 250px; opacity: 0.08; }

@keyframes blobFloat {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -30px) scale(1.05); }
    66% { transform: translate(-10px, 10px) scale(0.95); }
    100% { transform: translate(0, 0) scale(1); }
}

/* Glassmorphism Card */
.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 2rem;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    position: relative;
    z-index: 10;
    margin: auto;
}

.brand-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.school-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 1rem;
    filter: drop-shadow(0 6px 12px rgba(79, 70, 229, 0.2));
}

.brand-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.025em;
    margin-bottom: 0.25rem;
}

.brand-tagline {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

/* Custom Input Styles */
.input-group-custom {
    margin-bottom: 1rem;
}

.label-custom {
    display: block;
    font-weight: 600;
    color: #475569;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    margin-left: 0.25rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i:not(.password-toggle) {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.input-custom {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    background: #fff;
    transition: all 0.3s;
    color: #1e293b;
}

.input-custom:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

.input-custom:focus + i {
    color: #6366f1;
}

.password-toggle {
    position: absolute;
    right: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
    font-size: 0.9rem;
}

.password-toggle:hover {
    color: #6366f1;
}

/* Premium Button */
.btn-premium {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 1rem;
    background: var(--primary-gradient);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 16px -4px rgba(79, 70, 229, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-premium:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px -4px rgba(79, 70, 229, 0.4);
}

/* Student Info Card */
.student-info-box {
    background: #f8fafc;
    border-radius: 1.25rem;
    padding: 0.85rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border: 1px solid #e2e8f0;
}

.student-avatar {
    width: 50px;
    height: 50px;
    border-radius: 1rem;
    background: #e2e8f0;
    object-fit: cover;
}

.student-details h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.student-details p {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

.status-lulus {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #10b98133;
}

.status-tidak-lulus {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #ef444433;
}

.status-pending {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #f59e0b33;
}

.link-secondary {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.link-secondary:hover {
    color: #4f46e5;
}

.alert-custom {
    padding: 1rem 1.25rem;
    border-radius: 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fee2e2;
}

/* Envelope Animation */
.envelope-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    margin-top: 1rem;
    cursor: pointer;
}

.envelope {
    position: relative;
    width: 280px;
    height: 180px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.envelope.open {
    transform: translateY(50px);
}

.envelope::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 90px 140px 0 140px;
    border-color: #f1f5f9 transparent transparent transparent;
    z-index: 3;
    transform-origin: top;
    transition: transform 0.6s 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.envelope.open::before {
    transform: rotateX(180deg);
    z-index: 1;
}

.envelope::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 140px 90px 140px;
    border-color: transparent #f8fafc #f8fafc #f8fafc;
    z-index: 2;
}

.envelope-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 90px 0 90px 140px;
    border-color: transparent transparent transparent #f1f5f9;
    z-index: 2;
}

.envelope-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 90px 140px 90px 0;
    border-color: transparent #f1f5f9 transparent transparent;
    z-index: 2;
}

.letter {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    height: 160px;
    background: #fff;
    border-radius: 8px;
    z-index: 1;
    transition: transform 0.8s 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.envelope.open .letter {
    transform: translateY(-120px);
    z-index: 4;
    height: auto;
    min-height: 220px;
}

.envelope-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    background: var(--primary-gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    pointer-events: none;
    transition: opacity 0.3s;
}

.envelope.open .envelope-label {
    opacity: 0;
}

.letter-content {
    opacity: 0;
    transition: opacity 0.5s 1s;
}

.envelope.open .letter-content {
    opacity: 1;
}

.letter-header {
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.letter-body {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
}

.letter-footer {
    margin-top: 1rem;
    width: 100%;
}

/* Confetti Effect */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f2d74e;
    position: absolute;
    top: -10px;
    z-index: 10;
    opacity: 0;
}

@keyframes confetti-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(400px) rotate(720deg); opacity: 0; }
}

/* Shimmer Loading Effect */
.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmerEffect 1.5s infinite;
}

@keyframes shimmerEffect {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
