@extends('adminlte.layouts.auth')

@section('content')
  <style>
    @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

    body {
      font-family: 'Roboto', sans-serif;
      background: linear-gradient(to right, #74ebd5, #acb6e5);
      color: #111;
      height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0;
    }

    .login-box {
      width: 100%;
      max-width: 450px;
      padding: 20px;
    }

    .login-logo a {
      font-size: 26px;
      font-weight: 700;
      color: #ffffff;
      text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .logo-img {
      width: 90px;
      height: 90px;
      object-fit: cover;
      border-radius: 50%;
      margin-bottom: 12px;
      box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    }

    .card {
      border-radius: 16px;
      box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
      overflow: hidden;
      background-color: #ffffff;
    }

    .login-card-body {
      padding: 40px;
    }

    .login-box-msg {
      margin-bottom: 30px;
      font-size: 18px;
      font-weight: 600;
      color: #444;
    }

    .form-control {
      background-color: #f8f9fa;
      border: 1px solid #ced4da;
      color: #333;
      border-radius: 10px;
      padding: 10px 15px;
      transition: all 0.3s ease;
    }

    .form-control:focus {
      border-color: #74ebd5;
      box-shadow: 0 0 0 3px rgba(116, 235, 213, 0.3);
    }

    .input-group-text {
      background-color: #e9f5ff;
      color: #333;
      border: 1px solid #ced4da;
      border-left: none;
      border-radius: 0 10px 10px 0;
    }

    .btn-primary {
      background-color: #5ab1f3;
      border-color: #5ab1f3;
      color: #fff;
      font-weight: 600;
      border-radius: 10px;
      padding: 10px;
      transition: all 0.3s ease;
    }

    .btn-primary:hover {
      background-color: #3d9ae5;
      border-color: #3d9ae5;
    }

    .icheck-primary input[type="checkbox"]:checked + label::before {
      background-color: #5ab1f3;
      border-color: #5ab1f3;
    }

    .text-center a {
      color: #333;
      font-weight: 500;
    }

    .text-center a:hover {
      text-decoration: underline;
      color: #000;
    }

    .input-group {
      border-radius: 10px;
      overflow: hidden;
    }

    .invalid-feedback {
      font-size: 14px;
      color: #e3342f;
      margin-top: 5px;
    }
  </style>

  <body class="login-page">
    <div class="login-box">

      <!-- LOGO -->
      <div class="login-logo mb-4 text-center">
        <img 
          src="{{ asset('assets/main/images/Sekolah.jpeg') }}" 
          alt="Logo Sekolah"
          class="logo-img"
        >
        <div>
          <a href="{{ route('home') }}">
            <b>{{ config('app.name', 'Laravel') }}</b>
          </a>
        </div>
      </div>

      <div class="card">
        <div class="card-body login-card-body">
          <p class="login-box-msg text-center">
            Silakan masuk untuk memulai sesi Anda
          </p>

          <form action="{{ route('login') }}" method="POST">
            @csrf

            <div class="input-group mb-3">
              <input type="email" name="email"
                class="form-control @error('email') is-invalid @enderror"
                value="{{ old('email') }}"
                placeholder="Email"
                required autofocus>
              <div class="input-group-append">
                <div class="input-group-text">
                  <span class="fas fa-envelope"></span>
                </div>
              </div>
            </div>
            @error('email')
              <span class="invalid-feedback d-block">
                <strong>{{ $message }}</strong>
              </span>
            @enderror

            <div class="input-group mb-3">
              <input type="password" name="password"
                class="form-control @error('password') is-invalid @enderror"
                placeholder="Password"
                required>
              <div class="input-group-append">
                <div class="input-group-text">
                  <span class="fas fa-lock"></span>
                </div>
              </div>
            </div>
            @error('password')
              <span class="invalid-feedback d-block">
                <strong>{{ $message }}</strong>
              </span>
            @enderror

            <div class="row mb-3 align-items-center">
              <div class="col-8">
                <div class="icheck-primary">
                  <input type="checkbox" id="remember" name="remember"
                    {{ old('remember') ? 'checked' : '' }}>
                  <label for="remember">Ingat Saya</label>
                </div>
              </div>
              <div class="col-4">
                <button type="submit" class="btn btn-primary btn-block">
                  Masuk
                </button>
              </div>
            </div>
          </form>

          <p class="mb-0 text-center">
            <a href="{{ route('register') }}">
              Belum punya akun? Daftar sekarang
            </a>
          </p>

        </div>
      </div>
    </div>
  </body>
@endsection
