/* ============================================
   CUSTOM LOGIN SCREEN STYLING - SABERIS
   UISplash inspired split layout design
   
   Color scheme: 
   - Black: #000000
   - Dark Gray: #1a1a1a
   - Blue Link: #1F6FD1
   - White: #FFFFFF
   - Gray borders: #E0E0E0
   ============================================ */

/* Reset and base */
body.login {
    background: #FFFFFF;
    display: flex;
    align-items: stretch;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body.login,
html.login {
    height: 100vh;
    margin: 0;
    padding: 0;
}

/* Body container - Split layout */
.login #body {
    padding: 0;
    margin: 0;
    display: flex;
    width: 100%;
    height: 100vh;
    align-items: stretch;
}

/* Hide footer & menu on login */
.login #footer,
.login #menu {
    display: none;
}

/* Left Panel - Dark branding section (40%) */
.login #body::before {
    content: '';
    display: block;
    width: 40%;
    min-height: 100vh;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    position: relative;
    overflow: hidden;
}

/* Animated background particles effect */
.login #body::before::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(31, 111, 209, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(31, 111, 209, 0.08) 0%, transparent 50%);
    animation: gradientShift 8s ease-in-out infinite;
    z-index: 1;
}

/* Logo and branding image styling */
.login .postbox .logo {
    max-width: 240px;
    height: auto;
    margin: 0 auto 30px auto;
    display: block !important;
}

/* Main branding text with animations */
.login .postbox::after {
    content: 'Transforme a Educação com Tecnologia';
    position: fixed;
    left: 60px;
    top: calc(50% - 60px);
    transform: translateY(-50%);
    max-width: 280px;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.4;
    color: #FFFFFF;
    z-index: 10;
    letter-spacing: -0.5px;
    animation: slideInLeft 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

/* Animated accent line before text */
.login .postbox::before {
    content: '';
    position: fixed;
    left: 60px;
    top: calc(50% - 120px);
    width: 50px;
    height: 4px;
    background: linear-gradient(90deg, #1F6FD1, #00D4FF);
    border-radius: 2px;
    z-index: 10;
    animation: expandWidth 0.8s ease-out 0.4s both;
    box-shadow: 0 0 20px rgba(31, 111, 209, 0.6);
}

/* Main login form container - Right side (60%) */
.login .postbox {
    width: 60% !important;
    max-width: none !important;
    background: #FFFFFF;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 60px;
    margin: 0 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow-y: auto;
}

/* Login form inner container */
.login .popTable {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    border-collapse: collapse;
}

/* Form title/header */
.login .postbox > thead th,
.login .postbox h3,
.login .postbox h2 {
    border: none;
    padding: 0 0 8px 0;
    text-align: left;
    background: none;
    font-size: 28px;
    font-weight: 700;
    color: #000000;
    margin: 0 0 40px 0;
    line-height: 1.2;
}

/* Subtitle below title - HIDDEN */
.login .postbox > thead th::after {
    content: '';
    display: none;
    font-size: 14px;
    font-weight: 400;
    color: #666666;
    margin-top: 8px;
}

/* Hide the default title text and add custom one */
.login .postbox h2 {
    font-size: 0;
}

.login .postbox h2::before {
    content: 'Faça login em sua conta';
    font-size: 28px;
    display: block;
}

.login .postbox h2::after {
    content: '';
    display: none;
    font-size: 14px;
    font-weight: 400;
    color: #666666;
    margin-top: 8px;
}

/* Social login buttons container */
.login .social-login-container {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 24px auto;
}

.login .social-login-btn {
    flex: 1;
    padding: 12px;
    border: 1.5px solid #E0E0E0;
    border-radius: 6px;
    background: #FFFFFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 44px;
}

.login .social-login-btn:hover {
    background: #F8FAFB;
    border-color: #1F6FD1;
    transform: translateY(-1px);
}

.login .social-login-btn img,
.login .social-login-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Divider "OR" styling */
.login .divider-or {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 28px auto;
    color: #999999;
    font-size: 13px;
    font-weight: 500;
    width: 100%;
    max-width: 400px;
}

.login .divider-or::before,
.login .divider-or::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #E0E0E0;
}

.login .divider-or span {
    padding: 0 16px;
    background: #FFFFFF;
}

/* Table rows spacing */
.login .popTable td {
    padding: 0 0 20px 0;
    border: none;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.login .popTable tr:first-child td {
    padding-top: 0;
}

.login .popTable tbody > tr:first-child td {
    padding: 0 !important;
}

/* Form labels */
.login .popTable label {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    font-weight: 500;
    color: #333333;
    font-size: 14px;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.4;
    text-align: left;
    width: 100%;
    order: -1;
}

.login .popTable label span {
    display: block;
    order: -1;
}

/* Reorder input fields to appear after label */
.login .popTable label input {
    order: 1;
    margin-top: 8px;
}

/* Input fields styling */
.login #loginform input[type=text],
.login #loginform input[type=password],
.login #loginform input[type=email] {
    font-weight: 400;
    font-size: 15px;
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 14px !important;
    margin: 0 !important;
    border: 1.5px solid #E0E0E0 !important;
    border-radius: 6px;
    box-shadow: none !important;
    background: #FFFFFF !important;
    color: #000000;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
    text-align: left;
    display: block;
}

.login #loginform input[type=text]::placeholder,
.login #loginform input[type=password]::placeholder,
.login #loginform input[type=email]::placeholder {
    color: #999999;
}

.login #loginform input[type=text]:focus,
.login #loginform input[type=password]:focus,
.login #loginform input[type=email]:focus {
    border-color: #1F6FD1 !important;
    box-shadow: 0 0 0 3px rgba(31, 111, 209, 0.1) !important;
    background: #FFFFFF !important;
    outline: none;
}

/* Forgot password link */
.login .align-right {
    text-align: right;
    margin-top: 8px;
}

.login .align-right a {
    font-size: 13px;
    color: #666666;
    text-decoration: none;
    font-weight: 500;
}

.login .align-right a:hover {
    color: #1F6FD1;
}

/* Login button */
.login input[type=submit],
.login .button-primary {
    width: 100% !important;
    padding: 14px !important;
    margin: 28px 0 0 0 !important;
    background: #000000 !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
}

.login input[type=submit]:hover,
.login .button-primary:hover {
    background: #1a1a1a !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.login input[type=submit]:active,
.login .button-primary:active {
    transform: translateY(0);
}

/* Links styling */
.login .popTable a,
.login a {
    color: #1F6FD1;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 14px;
    display: block;
    text-align: center;
}

.login .popTable a:hover,
.login a:hover {
    text-decoration: underline;
}

/* Center text */
.login .center,
.login p.center {
    text-align: center;
}

/* Error messages */
.login div.error {
    background: #FEE;
    border-left: 4px solid #DC2626;
    padding: 12px 16px;
    margin: 0 auto 20px auto;
    border-radius: 6px;
    color: #DC2626;
    font-size: 14px;
    max-width: 400px;
}

.login div.error p {
    margin: 0;
}

/* Success messages - HIDDEN */
.login div.updated,
.login div.note {
    display: none !important;
    background: #E8F5E9;
    border-left: 4px solid #059669;
    padding: 12px 16px;
    margin: 0 auto 20px auto;
    border-radius: 6px;
    color: #047857;
    font-size: 14px;
    max-width: 400px;
}

.login div.updated p,
.login div.note p {
    margin: 0;
}

/* Hide default logo - keep saberis image visible */
.login .postbox img[src*="logo"],
.login .postbox img[src*="default"] {
    display: none !important;
}

.login .postbox img[src*="saberis"] {
    display: block !important;
}

/* Hide toggle/about section */
.login .toggle,
.login label.toggle,
.login .about-rosariosis {
    display: none !important;
}

/* Language selector styling */
.login .popTable tbody > tr:first-child td {
    margin-bottom: 20px;
}

.login .popTable tbody > tr:first-child td img {
    width: 32px;
    height: auto;
    margin-right: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.login .popTable tbody > tr:first-child td img:hover {
    transform: scale(1.1);
}

/* Additional account creation links */
.login form + p.align-right {
    max-width: 400px;
    margin: 12px auto 0 auto;
    text-align: center;
}

/* Responsive design for tablets */
@media only screen and (max-width: 1024px) {
    .login #body::before {
        width: 35%;
    }

    .login .postbox {
        width: 65% !important;
        padding: 50px 40px;
    }

    .login .postbox::before,
    .login .postbox::after {
        left: 50px;
    }
}

/* Responsive design for mobile */
@media only screen and (max-width: 768px) {
    body.login {
        flex-direction: column;
    }

    .login #body {
        flex-direction: column;
    }

    .login #body::before {
        width: 100%;
        min-height: 200px;
        max-height: 200px;
    }

    .login .postbox {
        width: 100% !important;
        padding: 40px 30px;
        height: auto;
        min-height: calc(100vh - 200px);
    }

    .login .postbox::before {
        left: 30px;
        top: 80px;
        transform: none;
        font-size: 28px;
    }

    .login .postbox::after {
        left: 30px;
        top: 120px;
        transform: none;
        max-width: calc(100% - 60px);
        font-size: 14px;
    }

    .login .popTable {
        max-width: 100%;
    }

    .login .social-login-container {
        flex-direction: column;
        max-width: 100%;
    }

    .login .social-login-btn {
        width: 100%;
    }

    .login .divider-or {
        max-width: 100%;
    }

    .login div.error,
    .login div.updated,
    .login div.note {
        max-width: 100%;
    }

    .login form + p.align-right {
        max-width: 100%;
    }
}

/* Responsive design for small phones */
@media only screen and (max-width: 480px) {
    .login #body::before {
        min-height: 180px;
        max-height: 180px;
    }

    .login .postbox {
        padding: 30px 20px;
        min-height: calc(100vh - 180px);
    }

    .login .postbox::before {
        left: 20px;
        top: 70px;
        font-size: 24px;
    }

    .login .postbox::after {
        left: 20px;
        top: 105px;
        max-width: calc(100% - 40px);
        font-size: 13px;
    }

    .login .postbox > thead th,
    .login .postbox h3,
    .login .postbox h2 {
        font-size: 24px;
    }

    .login .postbox h2::before {
        font-size: 24px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    body.login {
        background: #1a1a1a;
    }

    .login #body::before {
        background: #000000;
    }

    .login .postbox {
        background: #1a1a1a;
        color: #e0e0e0;
    }

    .login .postbox > thead th,
    .login .postbox h3,
    .login .postbox h2,
    .login .postbox h2::before {
        color: #FFFFFF;
    }

    .login .postbox > thead th::after,
    .login .postbox h2::after {
        color: #999999;
    }

    .login .popTable label {
        color: #c0d0e0;
    }

    .login #loginform input[type=text],
    .login #loginform input[type=password],
    .login #loginform input[type=email] {
        background: #2a2a2a !important;
        color: #e0e0e0;
        border-color: #404040 !important;
    }

    .login #loginform input[type=text]:focus,
    .login #loginform input[type=password]:focus,
    .login #loginform input[type=email]:focus {
        border-color: #1F6FD1 !important;
        background: #2a2a2a !important;
    }

    .login .social-login-btn {
        background: #2a2a2a;
        border-color: #404040;
        color: #e0e0e0;
    }

    .login .social-login-btn:hover {
        background: #333333;
        border-color: #1F6FD1;
    }

    .login .divider-or {
        color: #888;
    }

    .login .divider-or::before,
    .login .divider-or::after {
        border-color: #404040;
    }

    .login .divider-or span {
        background: #1a1a1a;
    }

    .login .align-right a {
        color: #888;
    }

    .login .align-right a:hover {
        color: #1F6FD1;
    }
}

/* Print styles */
@media print {
    body.login,
    .login #body::before,
    .login .postbox {
        background: white;
    }

    .login #body::before,
    .login .postbox::before,
    .login .postbox::after {
        display: none;
    }

    .login .postbox {
        width: 100% !important;
        padding: 20px !important;
    }

    .login .postbox .logo {
        display: block !important;
    }

    .login .toggle,
    .login label.toggle,
    .login .about-rosariosis {
        display: block !important;
    }
}

/* ============================================
   ANIMATION KEYFRAMES
   ============================================ */

/* Gradient shift animation for left panel */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Slide in from left animation */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Expand width animation for accent line */
@keyframes expandWidth {
    from {
        width: 0;
        opacity: 0;
        box-shadow: 0 0 0 rgba(31, 111, 209, 0);
    }
    to {
        width: 50px;
        opacity: 1;
        box-shadow: 0 0 20px rgba(31, 111, 209, 0.6);
    }
}

/* Floating animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Header Personalization Styles */
.header-center-info {
    display: flex;
    align-items: center;
    gap: 30px;
    justify-content: center;
    flex: 1;
}

.header-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.15) 0%, rgba(0, 153, 255, 0.1) 100%);
    padding: 12px 20px;
    border-radius: 8px;
    border-left: 4px solid #0066cc;
    min-width: 110px;
}

.header-time .time {
    font-size: 18px;
    font-weight: bold;
    color: #0066cc;
    letter-spacing: 1px;
}

.header-time .date {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    font-weight: 500;
}

.session-time {
    font-size: 12px;
    color: #777;
    font-weight: 500;
    margin-right: 20px;
    display: flex;
    align-items: center;
}

.header-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-right: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(240, 240, 240, 0.5);
    padding: 8px 12px 8px 8px;
    border-radius: 20px;
    border: 1px solid rgba(200, 200, 200, 0.3);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #0066cc;
    background: #f0f0f0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    min-width: 120px;
}

.user-profile-badge {
    display: inline-block;
    background: linear-gradient(135deg, #0066cc 0%, #0099ff 100%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}